I have a question for the DataGridView in vb.net (making a form).
I have a button that is disabled. This button should only be enabled when a row in this list is marked/selected/highlighted. How can i write this? A doubleclick on the DataGridView gives me
Private Sub My_Grid_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles My_Grid.CellContentClick
End Sub
This only works on some of the cells and does not do any thing if i click on the * to the left where i select and highlight this row.
How do i do this?
Best Answer
You need to change the Event name to
Handles My_Grid.SelectedIndexChanged
So the full Sub would be something like