all groups > dotnet windows forms > august 2006 >
You're in the

dotnet windows forms

group:

DataGridViewCheckBoxColumn


DataGridViewCheckBoxColumn jsh02_nova NO[at]SPAM hotmail.com
8/4/2006 10:41:01 AM
dotnet windows forms:
What would prevent a DataGridViewCheckBoxColumn control in a DataGridView
Re: DataGridViewCheckBoxColumn Kevin Spencer
8/4/2006 2:50:39 PM
What is the type of the data in the DataColumn?

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Who is Mighty Abbott? A twin-turret scalawag.

"jsh02_nova@hotmail.com" <jsh02novahotmailcom@discussions.microsoft.com>
[quoted text, click to view]

Re: DataGridViewCheckBoxColumn jsh02_nova NO[at]SPAM hotmail.com
8/6/2006 4:50:02 PM
Thanks for the response.
The Data type is Boolean. I've check the DataPropertyName and they both
match. The CurrentCellChangedValue event fires and the underlying datatable
changes also, but that is my only hint that some has changed, is that the
ChangedValue event fires. The CurrentCellIsDirty value never changes for the
DataGridView.
Do you have any clues as to what causes this behavior in a winform?

[quoted text, click to view]
Re: DataGridViewCheckBoxColumn Kevin Spencer
8/6/2006 9:47:31 PM
I just checked this out with an app I have written, and the
IsCurrentCellDirty property does change. When are you checking it? When you
click a DatGridViewCheckBoxCell, there are several events that fire,
depending on the circumstances. First, if another cell had the focus, the
CellEndEdit event fires. At this point, the CurrentCell is not the
DataGridViewCheckBoxCell. After it is checked, the CellValidating event
fires. At this point, the IsCurrentCellDirty property is still false, even
though the CheckBox value is changed. It is when the CellEndEdit event fires
that the actual underlying value is changed, and the IsCurrentCellDirty
property is true.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Expect the unaccepted.

"jsh02_nova@hotmail.com" <jsh02novahotmailcom@discussions.microsoft.com>
[quoted text, click to view]

Re: DataGridViewCheckBoxColumn jsh02_nova NO[at]SPAM hotmail.com
8/7/2006 4:57:01 AM
Thanks for the response Kevin,
First I'm checking the IsCurrentCellDirty property during the
CellValueChanged event fires. My CellBeginEdit and CellEndEdit events never
fire. I have to change the value of the cell programmatically during the
CellClicked event, because the check box control won't do it for me
automatically. The only other event that does fire is the CellFormatting and
the CellEnter.
Thanks for you help.

[quoted text, click to view]
Re: DataGridViewCheckBoxColumn Kevin Spencer
8/7/2006 8:20:58 AM
Well, I'm stumped. Assuming that your DataGridView is bound to a DataTable
via a BindingSource, which is the scenario I'm working with, it should fire
all of those events (at different times). And you should not have to change
the value of the cell programmatically.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Expect the unaccepted.

"jsh02_nova@hotmail.com" <jsh02novahotmailcom@discussions.microsoft.com>
[quoted text, click to view]

AddThis Social Bookmark Button