Trying to detect when a checkbox is ticked/unticked in a datagridview checkbox column (WinForms)
Check Box Column Creation Code:
Checkbox Click Detection Code: (Column[1] is the column of checkboxes)
Showcase of output:
https://gyazo.com/101659e8af97d91876baa8a6cf4d1834
Seems to return true/false very randomly anyone have any idea why this happens.
Thanks
3 Replies
It is not returning randomly. It is the opposite of what seems to be right
This happens when your click handler returns the value of the CheckBoxCell before it actually has time to commit its value changes
CurrentCellDirtyStateChanged
is the event to handle this commit stuffDataGridView.CurrentCellDirtyStateChanged Event (System.Windows.Forms)
Occurs when the state of a cell changes in relation to a change in its contents.
Thank you I’ll have a go with this later I’ll let you know how it goes
That worked thank you