Reputation: 321
I have a dataGridView. I will post a picture of it.
I am wanting to know how I could execute code on selection of each member name.
Upvotes: 0
Views: 1742
Reputation: 545
You can use the CellClik event and check if the column index is the desired column. For example:
Private Sub DataGridView1_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick
If e.ColumnIndex = 1 Then
MessageBox.Show(DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value)
End If
End Sub
Upvotes: 2