DataGridView checkbox.

  • Thread starter Thread starter Mr. X.
  • Start date Start date
M

Mr. X.

When I use dataGridView, and one of it's elements is a checkBox.
How can I catch the event, exactly when the checkBox is changed.
CellValueChanged is not good enough, since the event occurs after both two
steps :
1. I change the value of the cell.
2. I move to another cell.

I want exactly when the checkBox.checked is changed
(DataGridViewCheckBoxCell).

Thanks :)
 
When I use dataGridView, and one of it's elements is a checkBox.
How can I catch the event, exactly when the checkBox is changed.
I want exactly when the checkBox.checked is changed
(DataGridViewCheckBoxCell).

Handle the CurrentCellDirtyStateChanged event; in this routine, if the
CurrentCell happens to be a DataGridViewCheckBoxCell, call CommitEdit;
that should get the CellChanged event to fire straight away.

HTH,
Phill W.
 
Thanks.
How can I see the "dirty" new-value.
On CurrentCellDirtyStateChanged, I can see the old-value.

Thanks :)
 
I meant - to check the value of the object to be changed to, and for some
condition do : cancelEdit.

Thanks :)
 
Thanks.
Everything was solved. Ignore the rest.
(There are situation, that when I do commitEdit, and reach the
CellValueChanged, I am in state of edit mode. co I can do endEdit on some
circumstances,
I.e, when the checkbox is invalid value, for some cases, and I need to
restore it to original value).

Thanks :)
 
Back
Top