Multi-Column with Page Methods

3 posts, 0 answers
  1. ColinBowern
    ColinBowern avatar
    51 posts
    Member since:
    Aug 2012

    Posted 21 Jun 2009 Link to this post

    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. ColinBowern
    ColinBowern avatar
    51 posts
    Member since:
    Aug 2012

    Posted 21 Jun 2009 Link to this post

    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?


  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 25 Jun 2009 Link to this post

    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.
Back to Top