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

Rad-Combobox databind at Clientside using javascript

7 Answers 746 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Natraj T
Top achievements
Rank 1
Natraj T asked on 16 Sep 2009, 09:48 AM
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

7 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 16 Sep 2009, 03:54 PM
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.
0
Natraj T
Top achievements
Rank 1
answered on 17 Sep 2009, 06:53 AM
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
0
xrimson
Top achievements
Rank 1
answered on 26 Mar 2010, 07:04 PM
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.
0
xrimson
Top achievements
Rank 1
answered on 26 Mar 2010, 07:06 PM
Oh, I guess I should share what the error is :)

"Object doesn't support this property or method"

on sender.insertItems(items)
0
xrimson
Top achievements
Rank 1
answered on 26 Mar 2010, 07:36 PM
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); 
   } 

0
Shahid
Top achievements
Rank 1
answered on 21 Aug 2017, 07:54 AM

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.

0
sunil
Top achievements
Rank 1
answered on 30 Nov 2017, 03:56 PM
how to bind the list with ajax call?
Tags
ComboBox
Asked by
Natraj T
Top achievements
Rank 1
Answers by
Simon
Telerik team
Natraj T
Top achievements
Rank 1
xrimson
Top achievements
Rank 1
Shahid
Top achievements
Rank 1
sunil
Top achievements
Rank 1
Share this question
or