From: Mr. X. on 24 Jun 2010 06:54 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 :)
From: Phill W. on 24 Jun 2010 07:26 On 24/06/2010 11:54, Mr. X. wrote: > 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.
From: Mr. X. on 24 Jun 2010 07:51 Thanks. How can I see the "dirty" new-value. On CurrentCellDirtyStateChanged, I can see the old-value. Thanks :) "Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-k> wrote in message news:hvvfd3$j9k$1(a)south.jnrs.ja.net... > On 24/06/2010 11:54, Mr. X. wrote: >> 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.
From: Mr. X. on 24 Jun 2010 07:55 I meant - to check the value of the object to be changed to, and for some condition do : cancelEdit. Thanks :) "Mr. X." <nospam(a)nospam_please.com> wrote in message news:usR5sO5ELHA.1868(a)TK2MSFTNGP05.phx.gbl... > Thanks. > How can I see the "dirty" new-value. > On CurrentCellDirtyStateChanged, I can see the old-value. > > Thanks :) > > "Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-k> wrote in message > news:hvvfd3$j9k$1(a)south.jnrs.ja.net... >> On 24/06/2010 11:54, Mr. X. wrote: >>> 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. >
From: Mr. X. on 25 Jun 2010 03:01 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 :) "Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-k> wrote in message news:hvvfd3$j9k$1(a)south.jnrs.ja.net... > On 24/06/2010 11:54, Mr. X. wrote: >> 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.
|
Pages: 1 Prev: Tutorial for Beginner Next: That assembly does not allow partially trusted callers |