Rad-Combobox databind at Clientside using javascript

8 posts, 0 answers
  1. Natraj T
    Natraj T avatar
    12 posts
    Member since:
    Jul 2009

    Posted 16 Sep 2009 Link to this post

    Hi

        I have a Genric list of data returned from WCF in client side. I need to bind this  to RadCombobox in clientside itself using javascript, We have a direct method to  RadGrid to bind the data but there is no direct way to bind it with RadCombobox. I'm looping each item and add to the Radcombobox now. Is there any method to bind the Genric list(JSON object) to the RadCombobox.

    Please help me.

    (Please dont give examples like using page method or any server side method, my requirement is to use everything using javascript. In my page, i didnt use any single line of server side code except the WCF)

    Thanks in advance
  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 16 Sep 2009 Link to this post

    Hi Natraj T,

    Currently RadComboBox does not support such a method. However we are working on a similar one, which you could use as in the example below:

    function onLoad(sender) { 
        var items = []; 
         
        for (var i = 0; i < 5; i++) { 
        var item = new Telerik.Web.UI.RadComboBoxItem(); 
        item.set_text(i + ""); 
        //Set other properties or attributes... 
        items[items.length] = item; 
        } 
         
        sender.insertItems(items); 

    Would this approach be useful and usable in your case?

    Best wishes,
    Simon
    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.
  3. Natraj T
    Natraj T avatar
    12 posts
    Member since:
    Jul 2009

    Posted 17 Sep 2009 Link to this post

    Hi

    Thanks for the reply. But i have already used the above method and its working well. We are currently in preformance tuning, Looping takes bit more tme, so i felt if i have method which bind the data directly, the preformance may increase.

    Anyhow thanks for the help
  4. xrimson
    xrimson avatar
    7 posts
    Member since:
    Sep 2009

    Posted 26 Mar 2010 Link to this post

    This doesn't seem to be working for me.  Using a RadComboBox inside a RadGrid..
       <telerik:RadGrid ID="DeliverablesGrid" runat="server" AutoGenerateColumns="false"
          <MasterTableView> 
             <Columns> 
                ... 
                <telerik:GridTemplateColumn HeaderText="Owner"
                   <ItemTemplate> 
                      <telerik:RadComboBox ID="OwnerComboBox" AllowCustomText="false" runat="server" 
                         EmptyMessage="[None]" OnClientLoad="OwnerComboBox_OnLoad" > 
                      </telerik:RadComboBox> 
                   </ItemTemplate> 
                </telerik:GridTemplateColumn> 
             </Columns> 
          </MasterTableView> 
       </telerik:RadGrid> 
    function OwnerComboBox_OnLoad(sender, eventArgs) 
       var items = []; 
     
       for (var i = 0; i < 5; i++) 
       { 
          var item = new Telerik.Web.UI.RadComboBoxItem(); 
          item.set_text(i + ""); 
          items[items.length] = item; 
       } 
       sender.insertItems(items); 

    Please help.
  5. xrimson
    xrimson avatar
    7 posts
    Member since:
    Sep 2009

    Posted 26 Mar 2010 Link to this post

    Oh, I guess I should share what the error is :)

    "Object doesn't support this property or method"

    on sender.insertItems(items)
  6. xrimson
    xrimson avatar
    7 posts
    Member since:
    Sep 2009

    Posted 26 Mar 2010 Link to this post

    Got it working...
    function OwnerComboBox_OnLoad(sender, eventArgs) 
       for (var i = 0; i < 5; i++) 
       { 
          var item = new Telerik.Web.UI.RadComboBoxItem(); 
          item.set_text(i + ""); 
          sender.get_items().add(item); 
       } 

  7. Shahid
    Shahid avatar
    1 posts
    Member since:
    Aug 2017

    Posted 21 Aug 2017 Link to this post

    please help me... i want to bind combobox using ajax like ASP drop down list. I am using ajax but it not working.

     

    Please help me.

  8. sunil
    sunil avatar
    4 posts
    Member since:
    Nov 2017

    Posted 30 Nov 2017 in reply to xrimson Link to this post

    how to bind the list with ajax call?
Back to Top