csharp_learner
asked on
DataGridView Selected cell C#
Hi, this is my first time dealing with selected cell in the datagridview.
My scenario is I have a datagridview1 which read from a Oracle database.
It'll list out the data inisde the selected item(so i might have 2 rows or 6 rows depending on the selected data.)
My question is can I make it in a way the user selects a row and press a button then it'll pass the value of column 1 inisde the selected row of datagridview1 So I can use it in another function.Something like Selected.Tag in treeview.
I'd appreciate if you could tell me which event to use.Thanks.
My scenario is I have a datagridview1 which read from a Oracle database.
It'll list out the data inisde the selected item(so i might have 2 rows or 6 rows depending on the selected data.)
My question is can I make it in a way the user selects a row and press a button then it'll pass the value of column 1 inisde the selected row of datagridview1 So I can use it in another function.Something like Selected.Tag in treeview.
I'd appreciate if you could tell me which event to use.Thanks.
ASKER
Thanks for your reply,
Do I need to bind the datagridview to an event for this?
I'm letting the user to use the click button, So how can i access to the
"var col1val = DataGriidView.Item(Column1 ,SelectedR ow).Value; "
from the button_click function?
Do I need to bind the datagridview to an event for this?
I'm letting the user to use the click button, So how can i access to the
"var col1val = DataGriidView.Item(Column1
from the button_click function?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
var col1val = DataGriidView.Item(Column1