Jess31
asked on
DataGridView / CheckBox column?`
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?
What Event should I use when I want to be alerted when the Checkbox has changed?
Datagridview ---> CellValueChanged event
ASKER
This does not work. Only when you leave the Cell, not when the checkbox check changed.
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.
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..::.CurrentCe llDirtySta teChanged event. In the handler, if the current cell is a check box cell, call the DataGridView..::.CommitEdi t method and pass in the Commit value.
</MSDN>
It seems that you need to handle DataGridView.CurrentCellDi rtyStateCh anged Event.
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.currentcelldirtystatechanged.aspx
<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..::.CurrentCe
</MSDN>
It seems that you need to handle DataGridView.CurrentCellDi
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.currentcelldirtystatechanged.aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.