HighTechTalks DotNet Forums  

DataGridView checkbox.

VB.net microsoft.public.dotnet.languages.vb


Discuss DataGridView checkbox. in the VB.net forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Mr. X.
 
Posts: n/a

Default DataGridView checkbox. - 06-24-2010 , 05:54 AM






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

Reply With Quote
  #2  
Old   
Phill W.
 
Posts: n/a

Default Re: DataGridView checkbox. - 06-24-2010 , 06:26 AM






On 24/06/2010 11:54, Mr. X. wrote:
Quote:
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.

Reply With Quote
  #3  
Old   
Mr. X.
 
Posts: n/a

Default Re: DataGridView checkbox. - 06-24-2010 , 06:51 AM



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

Quote:
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.

Reply With Quote
  #4  
Old   
Mr. X.
 
Posts: n/a

Default Re: DataGridView checkbox. - 06-24-2010 , 06:55 AM



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

Thanks

"Mr. X." <nospam (AT) nospam_please (DOT) com> wrote

Quote:
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 (AT) south (DOT) 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.

Reply With Quote
  #5  
Old   
Mr. X.
 
Posts: n/a

Default Re: DataGridView checkbox. - 06-25-2010 , 02:01 AM



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

Quote:
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.

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.