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. Image for the cookie policy date

MultiColumnComboBox

Hi, How do I display two columns values concatenated in the MulticolumnCombox. Here is what I am doing right now: this.multiColumnComboBox1.DataSource = dsUs; this.multiColumnComboBox1.DisplayMember = dsUs.FirstNameColumn.ColumnName; this.multiColumnComboBox1.ValueMember = dsUs.UserIDColumn.ColumnName; Here is what I want(some thing like that): this.multiColumnComboBox1.DisplayMember = dsUs.FirstNameColumn.ColumnName + "," + dsUs.LastNameColumn.ColumnName Is this possible at all? Thanks,

2 Replies

AD Administrator Syncfusion Team October 27, 2005 06:12 PM UTC

Can''t you add another column to your DataTable that is the concatenation of the other two columns and then bind to this new column? >Hi, >How do I display two columns values concatenated in the MulticolumnCombox. > >Here is what I am doing right now: > >this.multiColumnComboBox1.DataSource = dsUs; >this.multiColumnComboBox1.DisplayMember = dsUs.FirstNameColumn.ColumnName; >this.multiColumnComboBox1.ValueMember = dsUs.UserIDColumn.ColumnName; > >Here is what I want(some thing like that): > > >this.multiColumnComboBox1.DisplayMember = dsUs.FirstNameColumn.ColumnName + "," + dsUs.LastNameColumn.ColumnName > >Is this possible at all? > >Thanks, > >


AR Anupama Roy Syncfusion Team October 31, 2005 03:10 PM UTC

Hi Ramana, Here is one way you can do this. You can add a computed column to DataTable that is the concatenation of the first name and last name columns. Then for the MultiColumnComboBox, set the DisplayMember to be this new computed column so it shows the concatenated value. Below is a link to a Windows Forms FAQ entry showing how you can add a computed column to a datatable that is the datasource of a DataGrid, but the same techniques will add a computed column to the datasource of your MultiColumnComboBox column. Let me know if you need more information, or if this does not work for you. How do I use the DataColumn.Expression property to add a computed/combined column to my datagrid? http://www.syncfusion.com/faq/winforms/search/904.asp Regards, Anu.

Loader.
Live Chat Icon For mobile
Up arrow icon