Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2006

Tip: Looking for answers? Try searching our database.

DataGridViewCheckBoxColumn

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jsh02_nova@hotmail.com - 04 Aug 2006 18:41 GMT
What would prevent a DataGridViewCheckBoxColumn control in a DataGridView
from being bound to its data in the Datasource table?
Kevin Spencer - 04 Aug 2006 19:50 GMT
What is the type of the data in the DataColumn?

Signature

HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Who is Mighty Abbott? A twin-turret scalawag.

> What would prevent a DataGridViewCheckBoxColumn control in a DataGridView
> from being bound to its data in the Datasource table?
jsh02_nova@hotmail.com - 07 Aug 2006 00:50 GMT
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?

> What is the type of the data in the DataColumn?
>
> > What would prevent a DataGridViewCheckBoxColumn control in a DataGridView
> > from being bound to its data in the Datasource table?
Kevin Spencer - 07 Aug 2006 02:47 GMT
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.

Signature

HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Expect the unaccepted.

> Thanks for the response.
> The Data type is Boolean. I've check the DataPropertyName and they both
[quoted text clipped - 11 lines]
>> > DataGridView
>> > from being bound to its data in the Datasource table?
jsh02_nova@hotmail.com - 07 Aug 2006 12:57 GMT
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.

> I just checked this out with an app I have written, and the
> IsCurrentCellDirty property does change. When are you checking it? When you
[quoted text clipped - 22 lines]
> >> > DataGridView
> >> > from being bound to its data in the Datasource table?
Kevin Spencer - 07 Aug 2006 13:20 GMT
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.

Signature

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
[quoted text clipped - 38 lines]
>> >> > DataGridView
>> >> > from being bound to its data in the Datasource table?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.