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

Multi-Column with Page Methods

2 Answers 32 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
ColinBowern
Top achievements
Rank 1
ColinBowern asked on 21 Jun 2009, 08:49 PM
Any chance we could see the following example updated for 2009 Q1?  I'm interested in how to bind it using page methods and using jQuery (since it is already in the project).

WebService based load on demand multi-column combobox


Thanks,
Colin


2 Answers, 1 is accepted

Sort by
0
ColinBowern
Top achievements
Rank 1
answered on 21 Jun 2009, 10:00 PM
Actually it looks like the Q1 2009 package exposes most of this via the ClientItemDataBound event:

function Building_ClientItemDataBound(sender, args) 
    var item = args.get_item(); 
    var attributes = item.get_attributes(); 
    var id = attributes.getAttribute("Id"); 
    var name = attributes.getAttribute("Name"); 
    var address = attributes.getAttribute("Address"); 
    var city = attributes.getAttribute("City"); 
    var province = attributes.getAttribute("Province"); 
 
    item.set_text(id + " - " + name); 
    item.set_value(id); 
    item.get_element().innerHTML = 
        "<ul class=\"Building\"><li class=\"Id\">" + id + "</li>" + 
        "<li class=\"Name\">" + name + "</li>" + 
        "<li class=\"Address\">" + address + "</li>" + 
        "<li class=\"City\">" + city + "</li>" + 
        "<li class=\"Province\">" + province + "</li></ul>"

I didn't see an update method, so I figured we have to inject into innerHTML. Is that the best way to go about it?


0
Simon
Telerik team
answered on 25 Jun 2009, 08:29 AM
Hello colinbo,

You could also use the built-in support for client-side Templates of ASP.NET AJAX 4.0 in conjunction with the ItemDataBound event. Please see this blog post for a solid example of the approach.

Using jQuery would not be mandatory however, so it is up to you whether to use it (and when) or not.

All the best,
Simon
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
Tags
ComboBox
Asked by
ColinBowern
Top achievements
Rank 1
Answers by
ColinBowern
Top achievements
Rank 1
Simon
Telerik team
Share this question
or