Results 1 to 3 of 3

Thread: load data into form where double click on data grid view

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2013
    Posts
    30

    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

  2. #2
    Frenzied Member IanRyder's Avatar
    Join Date
    Jan 2013
    Location
    Healing, UK
    Posts
    1,232

    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

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2013
    Posts
    30

    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
  •  



Click Here to Expand Forum to Full Width