yopibest Level: Protégé
 Registered: 19-01-2009 Posts: 6
|
Re: Open new form when cell in datagridview is clicked
If you just want to display the content of the row you clicked, you can try the following:
'assume you have 3 column in the datagridview, the new form named form2. If the column is dinamic, you can use array.
Private Sub DataGridView1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.Click
Dim int As Integer = Me.DataGridView1.CurrentCell.RowIndex
Form2.Label1.Text = Me.DataGridView1.Item(0, int).Value
Form2.Label2.Text = Me.DataGridView1.Item(1, int).Value
Form2.Label3.Text = Me.DataGridView1.Item(2, int).Value
Form2.Show()
End Sub
It just the simple, for more task on the new form like updating or binding, you must define more detail.
Hope it help. Or if it's not what you intended, just ignore it.
|
|