Handling the
DataGridView.CellValueChanged
event worked for me.
Private Sub DataGridView1_CellValueChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellValueChanged
If e.RowIndex < 0 Then
Exit Sub
End If
If e.ColumnIndex = chboxclmShow.Index Then
If Me.DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value = False Then
Me.DataGridView1.CurrentCell = Nothing
Me.DataGridView1.Rows(e.RowIndex).Visible = False
End If
End If
End Sub
If you go this way remember that the event will not fire until you leave the cell.
chboxclmShow
is the
CheckBoxColumn