|
-
Jul 24th, 2012, 01:22 PM
#1
Thread Starter
Lively Member
Moving Contents of DataGridView Row to New Form
Hi Everyone,
I'm working with a datagrid which I've been able to populate with my data to with no problems. What I'm trying to do now is doubleclick on a row of data within the datagrid, then pull the contents of that row to a new form, with fields for each cell of that row for editing. I decided that I'd try using e.rowindex in the double click event, but I'm only able to get the actual numeric index to appear in the form. How would you go about grabbing the actual contents of the selected row and moving them to a new form?
Here is my current code. When executed the new form comes up, but its just displaying the number(index). I need to know how to extract the row contents so I can store them in a variable or something, so I can display in textboxes on the new form. Thanks in advance to anyone who can help me understand this.
Code:
Private Sub DataGridView1_CellDoubleClick(sender As Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellDoubleClick
Dim holdcells As String
If e.RowIndex >= 0 Then
holdcells = e.RowIndex.ToString()
EditTicket.Show()
EditTicket.TextBox1.Text = holdcells
End If
End Sub
End Class
Last edited by WRCREX; Jul 24th, 2012 at 01:35 PM.
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
|