Articles in this section
Category / Section

Why check box is not working fine in WinForms GridControl?

1 min read

Cell value type

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

C#

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

 

VB

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.

C#

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

 

VB

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

 

Samples:

C#: CheckBox_C#

VB: CheckBox_VB

Reference link: https://help.syncfusion.com/windowsforms/grid-control/enhanced-cell-types


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 Grid feature tour page to know about its other groundbreaking feature representations. You can also explore our documentation to understand how to present and manipulate data.

For current customers, you can check out our WinForms 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 ASP.NET MVC Chart and other ASP.NET MVC components.

If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forumsDirect-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 sign in to leave a comment
Access denied
Access denied