We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

checkbox cell does not work

I have GridGroupingControl form, want to show column "IsSupperSection" as checkbox. "IsSupperSection" column is numeric field (Not a boolean field). I used following code to set the column celltype. The checkbox does not display "CHECKED" for value other than 0; I clike the CheckBox, nothing happens. any idea? // ... load data gdBase.DataSource = mGridDataSet.Tables["MyTable"]; gdBase.TableDescriptor.Columns.LoadDefault(); string ColumnName="IsSupperSection"; this.gdBase.TableDescriptor.Columns.[ColumnName].Appearance.AnyRecordFieldCell.CellType ="CheckBox"; this.gdBase.TableDescriptor.Columns[ColumnName].Appearance.AnyRecordFieldCell.ShowButtons=GridShowButtons.ShowCurrentCell;

2 Replies

AD Administrator Syncfusion Team May 30, 2005 02:10 PM

You will also need to set teh CheckBoxOptions so the grid knows what values you are using for Checked and Unchecked. GridStyleInfo style = this.gridGroupingControl1.TableDescriptor.Columns["check"].Appearance.AnyRecordFieldCell; style.CellType ="CheckBox"; style.CheckBoxOptions = new GridCheckBoxCellInfo("1", "0", "", true); //use 1 and 0 for values


LM Lan Mo May 30, 2005 02:52 PM

Thanks Clay. My code works now. >I have GridGroupingControl form, want to show column "IsSupperSection" as checkbox. "IsSupperSection" column is numeric field (Not a boolean field). I used following code to set the column celltype. The checkbox does not display "CHECKED" for value other than 0; I clike the CheckBox, nothing happens. > >any idea? > > >// ... load data >gdBase.DataSource = mGridDataSet.Tables["MyTable"]; >gdBase.TableDescriptor.Columns.LoadDefault(); >string ColumnName="IsSupperSection"; >this.gdBase.TableDescriptor.Columns.[ColumnName].Appearance.AnyRecordFieldCell.CellType ="CheckBox"; >this.gdBase.TableDescriptor.Columns[ColumnName].Appearance.AnyRecordFieldCell.ShowButtons=GridShowButtons.ShowCurrentCell; >

Loader.
Live Chat Icon For mobile
Up arrow icon