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

MultiColumnDropDownCombo Question

Thread ID:





84475 Jul 1,2009 12:58 AM UTC Jul 6,2009 04:42 PM UTC ASP.NET Web Forms (Classic) 3
Tags: Tools
Administrator [Syncfusion]
Asked On July 1, 2009 12:58 AM UTC

I would like to make use of the MultiColumnDropDownCombo control for a variety of different "pick lists" within my application. For example, assume I have a Customers table with the following columns:

CustomerID GUID, Primary Key
CompanyName varchar(50)
City varchar(20)

I want to display a drop-down combo box that shows columns "CompanyName" and "City", but does not display the "CustomerID". When a selection is made, the text displayed in the control should be the CustomerName.Value.

Upon postback, I need to be able to query the "CustomerID" value associated with the selection in order to proceed with further processing.

I've struggled to find a way to make this work. It appears that the controls "DataKeyField" property is used to specify the displayed text, but there is no complementary property to specify the "CustomerID" as the selection value.

Also, if "AutoGenerateColumns" is set to true, then of course all columns in the data source are displayed. However, if set AutoGenerate... to false, then there is no obvious way to manually create the columns, and nothing within the documentation to help.

I thought I could add the columns at runtime in the Page_Load() event, but the Control.Columns collection expects to receive a DataGridColumn object, which cannot be instantiated because it has a protected constructor.

How does one accomplish this?

Melba Winshia [Syncfusion]
Replied On July 1, 2009 10:17 AM UTC

Hi John,

Thank you for your interest in Syncfusion Products.

You can manually define the column fields by setting the AutoGenerateColumns property to false and then creating a custom Columns collection. Please refer below code snippet to achieve this:

DataSourceID="AccessDataSource1" DataTextFormatField="{LastName} ({FirstName})"
PopupHeight="229px" PopupWidth="630px">

<%# DataBinder.Eval(Container, "DataItem.EmployeeID")%>

<%# DataBinder.Eval(Container, "DataItem.LastName")%>

<%# DataBinder.Eval(Container, "DataItem.FirstName")%>

<%# DataBinder.Eval(Container, "DataItem.HomePhone")%>

Please refer the sample in the below link which illustrates the above:


Please try this and let me know if this helps.


Administrator [Syncfusion]
Replied On July 6, 2009 03:45 PM UTC

Hello Melba,

Thank you for the example. When I try this method, data binding no longer seems to work. The control will not display any data. Here is the code I am using:



<%# DataBinder.Eval(Container,

ConnectionString="<%$ ConnectionStrings:myConnStr %>"
SelectCommand="SELECT [Display_Name],
FROM [vw_BoardVolunteers_Display_List]
WHERE ([Email_Published] IS NOT NULL)
ORDER BY [RoleType_SortOrder],

Administrator [Syncfusion]
Replied On July 6, 2009 04:42 PM UTC

Never mind.. I can see where I didn't enclose the properly within the control.


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

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