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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Why do I lose my choicelist when I try to use both the choicelists and DataSources to populate the ComboBoxes in different cells?

Platform: WinForms |
Control: GridControl |
Published Date: April 30, 2011 |
Last Revised Date: March 9, 2015

 

Problem

Normally, Essential Grid uses the same combobox for all the cells with the celltype ComboBox in the Grid. When you move from one combobox cell to another, the choicelist (or DataSource depending upon what you are using) is swapped out to reflect the settings of a new cell. When you try to swap the combobox cell by using a choicelist with a combobox cell by using a DataSource, it does not work.

Solution

To overcome this, create two ComboBox cell models, one for choicelists and another for DataSources. You can use the GridControl.CellModels.Add method to add this second celltype.

C#

VB

This registers a new celltype named ComboBoxDS that is just another ComboBox cell. You can use the ComboBoxDS as the celltype for your cells that require a DataSource, and use the ComboBox as the celltype for the cells that require a ChoiceList.

Adding the ChoiceList/DataSource to the ComboBox cell:

 C#

VB

 

Note:

This problem has been resolved in our later versions of Essential studio Grids.

Sample Links

ChoiceListDataSource-C#317625627.zip

ChoiceListDataSource-VB684465365.zip

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon