VB.NET 2005 DataGridView Checkbox - Check Event need to know check status
I would like to use the DataGridView Checkbox like a normal checkbox.
When someone clicks on it I would expect that I could get a checked or changed event and be able to test if the box was checked or unchecked.
For a normal checkbox. When it is checked you can test chk.checked and it is the current visible stated. Someone checks it and your test for chk.checked is true. If it was unchecked then chk.checked is false.
In the DGV this does not seem to be the case.
You check the checkbox and there is some data in the other cells in that row and the value is nothing.
Private Sub grdLogon_CellContentClick
If grdLogon.Item(2, e.RowIndex).Value Is Nothing Then
'>>> It comes here
End If
If grdLogon.Item(2, e.RowIndex).Value Then
' Expeced checked but comes here when it was all the time
end if
The test grdLogon.Item(2, e.RowIndex).Value seems to work fine when used in other places (not a event from grdLogon.
I do not understand when this object has a value and when it is nothing nor how to make it work like a normal CheckBox.
Thanks & Happy Holidays!
Jack