dgb
asked on
no change-event checkbox in datagridview
I have a datagridview but i can't find the change-event of the checkbox.
Thanks in advance.
Dirk
Thanks in advance.
Dirk
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I've been testing and if i manualy set the checkbox value it seems to go ok
' In the CellContentClick-event
After processing the checked-change i have to execute the following command else it doesn't work.
DataViewGrid.CurrentCell.V alue = Not DataViewGrid.CurrentCell.V alue
' In the CellContentClick-event
After processing the checked-change i have to execute the following command else it doesn't work.
DataViewGrid.CurrentCell.V
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
' my check box colum is the last grid colum
If e.ColumnIndex = (Me.DataGridView1.Columns.Count - 1) Then
If Me.DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value = True Then
Me.DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value = False
MessageBox.Show(Me.DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value)
Else
Me.DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value = True
MessageBox.Show(Me.DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value.ToString())
End If
End If
End Sub
ASKER
(it does fire when leaving the cell, but that doesn't work for me)
The cellcontentclick is also not working as it should.
When repeatedly click the checkbox i can not ask what the current value is.