[quoted text, click to view] On 6 Feb, 16:23, "DesperateDan" <dan.hill...@assureweb.co.uk> wrote:
> Can't believe I'm asking this but......
>
> I've got a datagridview control which has a checkbox column.
>
> I want to enable an UPDATE button as soon as any checkbox has changed
> (checked/unchecked).
>
> I'm currently trapping the event CellValueChanged however it doesn't
> fire unless you lose focus from that particular cell. (i.e. you gotta
> click on another cell for example to fire the event)
>
> Thanks in anticipation.
> Dan
I haven't had the chance to use .Net 2.0 at work but I came accross
this
http://msdn2.microsoft.com/en-us/library/ system.windows.forms.datagridview.cellvaluechanged(VS.80).aspx
The DataGridView.CellValueChanged event occurs when the user-specified
value is committed, which typically occurs when focus leaves the cell.
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.
Hope this helps. Oh and how's my old company by the way ? :)
Dan (not the same one)