Live Chat Icon For mobile
Live Chat Icon

How can I catch the bool values changing in a DataGridBoolColumn

Platform: WinForms| Category: Datagrid

There is no event fired when the boolean value changes. In the attached sample (C#, VB), a BoolValueChanged event has been added to a columnstyle derived from DataGridBoolColumn. Catching the changes requires some effort. The strategy is to save the current value when the cell begins being edited. This is done in an override of Edit. Then in a Paint override, checks are done to see if there is a click in the checkbox cell or if the space bar is hit. If either of these situations happen when the cell is actively being edited, the bool value is changed and the event fired.

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.