|
-
Apr 9th, 2013, 07:34 PM
#1
Thread Starter
Junior Member
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
-
Apr 9th, 2013, 09:55 PM
#2
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
-
Apr 10th, 2013, 12:11 PM
#3
Thread Starter
Junior Member
Re: load data into form where double click on data grid view
Thank you, really helpful!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|