Multicolumncombobox and checkbox

How do I make one of the columns in the drop-down of my multicolumncombobox a checkbox? I have tried this, but it doesn't seem to work:

this.McbSource.ListBox.Grid.Model.ColStyles[3].CellType = "CheckBox";
this.McbSource.ListBox.Grid.Model.ColStyles[3].CheckBoxOptions.CheckedValue = "1";
this.McbSource.ListBox.Grid.Model.ColStyles[3].CheckBoxOptions.UncheckedValue = "0";

2 Replies

AR Anupama Roy Syncfusion Team December 18, 2006 05:06 AM UTC

Hi Keyur,

Thank you for your interest in Syncfusion products.

MultiColumnComboBox uses the GridListControl internally and as it is a non editable grid it will have some limitations though it supports cell types.You need to handle the internal Grid's PrepareViewStyleInfo event in order to have a CheckBox as your cell type.


this.MultiColumnComboBox1.ListBox.Grid.PrepareViewStyleInfo +=new Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventHandler(Grid_PrepareViewStyleInfo);
private void Grid_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
{
if( e.RowIndex == 3 && e.ColIndex == 1)
{

e.Style.CellType ="CheckBox";
e.Style.CheckBoxOptions.CheckedValue="1";
e.Style.CheckBoxOptions.UncheckedValue ="0";
e.Style.CellValueType=typeof(bool);
e.Style.CellValue="1";
e.Style.Description="asha";


}


}





Please have a look at the sample attached and kindly let me know if you need further assistance.

Best regards,

Anu.






KP Keyur Patel December 26, 2006 05:22 PM UTC

This worked. Thank you.

Loader.
Up arrow icon