DataGridViewCheckBoxColumn

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What would prevent a DataGridViewCheckBoxColumn control in a DataGridView
from being bound to its data in the Datasource table?
 
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.
 
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?
 
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.
 
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.
 
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.
 
Back
Top