Articles in this section
Category / Section

Why check box is not working fine in WinForms GridControl?

1 min read

Cell value type


In the Boolean CellValueType, the check box selection will not work properly. The check mark will be enabled only after two clicks with the following code.

gridControl1[rowIndex, CheckBoxColumnIndex].CellValueType = typeof(bool);
gridControl1(rowIndex, CheckBoxColumnIndex).CellValueType = GetType(Boolean) 

Solution

This issue can be resolved by handling the intermediate option through the CheckBoxOptions property. Pass flateLook value as true to draw the flat checkbox, otherwise false.

gridControl1[rowIndex, CheckBoxColumnIndex].CheckBoxOptions = new GridCheckBoxCellInfo("true", "false", "indeterminate", true);
gridControl1(rowIndex, CheckBoxColumnIndex).CheckBoxOptions = New GridCheckBoxCellInfo("true", "false", "indeterminate", True) 

Samples:

C#: CheckBox_C#

VB: CheckBox_VB


Reference Link: Enhanced Cell Type

 

Conclusion

I hope you enjoyed learning on why the check box is not working fine when the CellValueType is set to bool in WinForms GridControl.


You can refer to our WinForms GridControl feature tour page to know about its other groundbreaking feature representations and WinForms GridControl documentation, and how to quickly get started for configuration specifications.


For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.


If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied