This is a migrated thread and some comments may be shown as answers.

Multicolumn Combo Box in a Grid

1 Answer 49 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 01 Dec 2009, 03:46 PM
Hi..
Do you have any examples of binding a combo box to a grid with multiple columns.  Specially - I'm trying to set the ItemSource of the combo box to 3 columns of values in code.

How do I also set the ComboBox's Item source

var query = from c in this.DataContext.Customers
      orderby c.Name
      select c;



this.cmbCustomers.ItemSource =  query.ToList()        <-- This doesn't work... 

thanks again

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 04 Dec 2009, 02:40 PM

Hello Jon The Nerd,

I am not sure I get the question right .

I assume you need a multicolumn combo box in a cell of RadGridView bound to a collection of Customers and you need to display three properties of a customer in the combo box.

If this is the case - here is the 'how to' :

The default GridViewComboBox column does not support multicolumn combo ( yet) . So you will have to place a combo box in the cell by  setting the CellTemplate property of the relevant column.

Within the cell template you should define  a Combo Box and  set its items source to your collection.
To achieve the multicolumn effect you shall not set the DisplayMember property, you should define an ItemTemplate for the combo instead. Within this item template you ensure the three columns.

If you give me  some more details on what exactly you are trying to achieve , I will gladly prepare a working example for you .

Regards,

Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Jon
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or