GridControl ComboBox only allow items in ChoiceList
Thank you for your interest in Syncfusion products.
You can restrict the editing of combo box cell by using the following code. Please refer the below sample and code for reference.
Code :
gridControl1[2, 3].CellType = "ComboBox";
//Set datasource for the combobox cell
gridControl1[2, 3].DataSource = items;
gridControl1[2, 3].CellValue = "Five";
gridControl1[2, 3].ExclusiveChoiceList = true;
gridControl1[2, 3].ReadOnly = true;
Sample :
http://www.syncfusion.com/downloads/support/forum/120719/ze/ComboBoxCell-CS-1433202679
Thanks & Regards,
AL.Solai.
Thank you for your update.
To restrict adding data from the Combo box, use the following two properties.
Code :
// User input is restricted to datasource/choicelist.
gridControl1[2, 3].ExclusiveChoiceList = true;
// User input is Restricted to items from datasource/choicelist.
gridControl1[2, 3].DropDownStyle = GridDropDownStyle.Exclusive;
Thanks,
AL.Solai.
Hi Taylour,
Thank you for your update.
The given properties will restrict the user from adding the input to combo box choice list / data source. The data given by the user will be temporarily viewed (it will not be updated in the combo box). Finally, we are glad that the requirement has been achieved.
Thanks & Regards,
AL.Solai.
- 6 Replies
- 2 Participants
-
TT tttmack
- Oct 8, 2015 05:20 AM UTC
- Oct 13, 2015 11:29 AM UTC