ict-torquilclark
asked on
DataGridView Checkbox Cell detect check
How can I detect when a datagridview checkbox cell is checked/unchecked?
ASKER
i mean which even trigger do i need to use?
check this
If CBool(dataGridView1.Rows[e.RowIndex].Cells[0].Value) = True Then
'Check box checked
Else
'Check box Unchecked
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi!
You an use CellContentClick event as other expert suggested, but i have another advice which i have experienced while working with Datagridview having checkboxColumn, sometimes when you checked a cell and want to access the value you will not get the updated value (like if you changed 'False' to 'True') you may get 'False'. So you should use:
before accessing the value the checkboxcell value.
You an use CellContentClick event as other expert suggested, but i have another advice which i have experienced while working with Datagridview having checkboxColumn, sometimes when you checked a cell and want to access the value you will not get the updated value (like if you changed 'False' to 'True') you may get 'False'. So you should use:
DatagridView1.EndEdit()
before accessing the value the checkboxcell value.
Open in new window