We have a Windows form application that has a DataGridView control containing a column with a checkbox in it.
When a user checks or unchecks the box in the row/cell in the DataGridView, we'd like to get the updated value (true or false).
The problem is, the value is always evaluated to true when using our current code implementation.
private void gvDocumentContents_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == 6)
{
DataGridViewRow dgvr = gvDocumentContents.Rows[e.RowIndex];
DataGridViewCheckBoxCell cbCell = dgvr.Cells[6] as DataGridViewCheckBoxCell;
MessageBox.Show(cbCell.Value.ToString());
}
}
I've seen similar issues regarding this topic, however after spending the better part of the day looking, I haven't had much success with some of the other solutions that we tried.
Thanks
Aucun commentaire:
Enregistrer un commentaire