AD
Administrator
Syncfusion Team
July 2, 2004 08:08 AM UTC
Your code will only work if Grid is a GridControl. If it is a GridDataBoundGrid, then you either must set these properties on the GridBoundColumn.StyleInfo for the column, or set these properties from within an event like Model.QueryCellInfo or PrepareViewStyleInfo.
If you are using a GridControl, try also setting
Grid[gridRow, (int)ColumnOffsets.ServerSelectedColumn].CheckBoxOptions = new GridCheckBoxCellInfo(true.ToString(), false.ToString(), "", false);
Grid[gridRow, (int)ColumnOffsets.ServerSelectedColumn].CellValueType = typeof(bool);
This code assumes you want to actually store bool values true and false into your datasource. If you are storing "1" ann "0", then you should change these lines to:
Grid[gridRow, (int)ColumnOffsets.ServerSelectedColumn].CheckBoxOptions = new GridCheckBoxCellInfo("1", "0", "", false);
Grid[gridRow, (int)ColumnOffsets.ServerSelectedColumn].CellValueType = typeof(string);