Home Forums WinForms controls Xceed Grid for WinForms C# Forcing a column to display checkbox Reply To: C# Forcing a column to display checkbox

User (Old forums)
Member
Post count: 23064

First, the datatype of the column should be <b>System.Boolean</b>.
Second, you should create an <b>Xceed.Grid.Editors.GridCheckBox</b> and use it as cellviewer and celleditor of the column, like this:<code>
Xceed.Grid.Editors.GridCheckBox checkbox = new Xceed.Grid.Editors.GridCheckBox();
Xceed.Grid.Column column = myGrid.Columns[“myBooleanColumn”];
column.CellViewer = checkbox;
column.CellEditor = checkbox;
</code>

If you want to check/uncheck a checkbox with only a single click, you can set the <b>SingleClickEdit</b> property of the gridcontrol to true.

Imported from legacy forums. Posted by Tommy (had 349 views)