- Mar 1, 2000
- 30,890
- 5,001
- 126
I ahve a Datagridview in a VB.net where the 1st column is a check box.
I'd like it so that when the checkbox is checked, he row is selected.
Obviously, if the checkbox is unchecked, then the row should un-select.
I think this can be accomplished witha "CellValueChanged" event (if there is a better one, let me know). But I'm drawing a blank on how to actually highlight the row that the checkbox is located in...
I'd like it so that when the checkbox is checked, he row is selected.
Obviously, if the checkbox is unchecked, then the row should un-select.
I think this can be accomplished witha "CellValueChanged" event (if there is a better one, let me know). But I'm drawing a blank on how to actually highlight the row that the checkbox is located in...
Code:
Public Sub dataGridView1_CellValueChanged(ByVal sender As Object, _
ByVal e As DataGridViewCellEventArgs) _
Handles DataGridView1.CellValueChanged
If DataGridView1.Columns(e.ColumnIndex).Name = "Column1" Then
'how do I select the row ?!?!
End If
End Sub