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

Load Multi-column ComboBox via Client Script

1 Answer 48 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Greg Harrison
Top achievements
Rank 1
Greg Harrison asked on 10 May 2010, 10:37 PM
Hello,

Presently I have several HTML drop-downs (<select> elements) that are populated via client-side JavaScript. I would like to convert these to Rad ComboBox controls in order to take advantage of the multi-column feature, in which I will show three columns (Category name, total sales, and market share). I was able to get a "server-side" version of a multi-column ComboBox running with the data desired.

I added "total sales" and "market share" values to the client-side objects I use for populating, and now I need to load these values dynamically via JavaScript into the multi-column RadCombo box, but I cannot determine how to do this. I tried the example where I create a comboItem using "new Telerik.Web.UI.RadComboBoxItem()" and call "set_text", but this only adds a single value to the ComboBox's drop-down area, and its off to the right side (not in a column).

Please advise, thanks.

G

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 11 May 2010, 01:30 PM
Hi Greg Harrison,

The direct way of achieving this is to insert the appropriate required HTML in the main element of each Item. As this can be a difficult task if you implement it from scratch, I suggest you use the Template mechanism of the Preview 4 of ASP.NET AJAX 4.0 (you can download only the required scripts and use them in your application).

Here is a blog post showing how to use the Template mechanism (you can abstract away from the Load On Demand / Web Service code if you do not need it).

All the best,
Simon
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ComboBox
Asked by
Greg Harrison
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or