load data into form where double click on data grid view
Hey Everyone
I currently have a data grid view on on form (Form 1). The data grid has 4 visible columns on it (First Name, Last Name, Age, DOB) and 1 hidden column (ID). Can someone show me show code where if the user double clicks on a row (doesn't matter what column, therefore they could click on the first name, last name, age or dob); then the data is stored into separate strings?
Hope this makes sense and thanks for reading
Re: load data into form where double click on data grid view
Hi,
You can do this by coding the CellDoubleClick event of the DataGridView and then use the CurrentRow property of the DataGridView to retrieve the Cells that you want to assign to variables i.e:-
Code:
Dim myVariable As String = DataGridView1.CurrentRow.Cells(1).Value.ToString
Hope that helps.
Cheers,
Ian
Re: load data into form where double click on data grid view
Thank you, really helpful!