?
Solved

DataGridView / CheckBox column?`

Posted on 2009-12-23
5
Medium Priority
?
735 Views
Last Modified: 2013-11-08
I'm using vb.net and DataGridView and Winforms.
What Event should I use when I want to be alerted when the Checkbox has changed?
0
Comment
Question by:Jess31
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

by:Arabia_vn
ID: 26117193
Datagridview ---> CellValueChanged event
0
 
LVL 1

Author Comment

by:Jess31
ID: 26117363
This does not work. Only when you leave the Cell, not when the checkbox check changed.
0
 
LVL 8

Expert Comment

by:Arabia_vn
ID: 26117542
I see. So you want the event raised right after the value of checkbox changed, then to my knowledge there's no way to do that. I tried many different ways on my project but couldn't find any good solution. So i had to use CellValueChanged, not very good but at least it did the job. Someone can do this plz post the solution.
0
 
LVL 10

Expert Comment

by:RameshS
ID: 26118344
From MSDN.

<MSDN>
In the case of check box cells, however, you will typically want to handle the change immediately. To commit the change when the cell is clicked, you must handle the DataGridView..::.CurrentCellDirtyStateChanged event. In the handler, if the current cell is a check box cell, call the DataGridView..::.CommitEdit method and pass in the Commit value.

</MSDN>

It seems that you need to handle DataGridView.CurrentCellDirtyStateChanged Event.
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.currentcelldirtystatechanged.aspx
0
 
LVL 10

Accepted Solution

by:
RameshS earned 2000 total points
ID: 26118383
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question