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

Using template class as cell combobox datasource

Thread ID:





99602 May 31,2011 01:14 PM UTC Jun 14,2011 03:42 AM UTC WinForms 3
Tags: GridControl
Christian Rattat
Asked On May 31, 2011 01:14 PM UTC


I'm trying to create a generic control derived from gridcontrol that uses IList as datasource for cell comboboxes. But the grid control tells me that I can only use IList or ISourceList. Is there a way to use generics anyway? I need to support list items in the comboboxes that have a string as displaymember but different value types that I don't know at compile time and I don't want to handle values as non typed objects.


Jisha Joy [Syncfusion]
Replied On June 6, 2011 09:12 AM UTC


Please refer to the following sample from our sample browser that illustrates the usage of ComboBox and MulticolumnGridList controls in grid cells. The dropdownlist can be populated with items in the following ways:

Through GridStyleInfo.ChoiceList property
Through GridStyleInfo.DataSource property

Sample location,

..\Windows\Grid.Windows\Samples\2.0\Cell Types\Combo Box Cell Demo\cs

Please refer to it and let me know if this helps.


Christian Rattat
Replied On June 8, 2011 12:28 PM UTC


thanks for the feedback. I'm aware of how using dropdowns in cells and were already using it for quite some time. The problem I have is not creating comboboxes but using a C# template class as datasource.

I don't want to use an arraylist or other containers from specialized collections because it does not use the actual types but object and does a lot of boxing/unboxing.

I want to use as container an implementation of IList. When I set

grid[row,col].DataSource = new IList;

I get an error telling me that I can use IList as datasource. So the question is whether I can use generics as datasource or if I still have to use depricated classes like arraylist here.


Jisha Joy [Syncfusion]
Replied On June 14, 2011 03:42 AM UTC

Hi Christian,

Please refer to the following attached sample, that uses a template class as a datasource to the dropdown in grid cell,




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to 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