Add item for Rad combo box in client side problem

2 posts, 0 answers
  1. Prasanna
    Prasanna avatar
    47 posts
    Member since:
    Oct 2012

    Posted 05 Mar 2013 Link to this post


    I have two rad combo box in my page. I have to add only combo1.checkeditems to combo2.

    I tried following code, I got get_parent() error.

    for(var item=0;combo1.get_checkedItems().length;item++){

    Please let me know its possible .......


  2. Hristo Valyavicharski
    Hristo Valyavicharski avatar
    975 posts

    Posted 08 Mar 2013 Link to this post

    Hi Prasanna,

    Yes, it is possible. I can suggest you to get the checked items from the first combo and assign text and value to a new item. Finally add this new item to RadComboBoxItems collection of the second RadComboBox in the following manner:
    <script type="text/javascript">
             function AddItems() {
                 var combo1 = $find('<%= RadComboBox1.ClientID%>');
                 var combo2 = $find('<%= RadComboBox2.ClientID%>');
                 for (var i = 0; i < combo1.get_checkedItems().length; i++) {
                     var item = new Telerik.Web.UI.RadComboBoxItem();
    This should be wrapped by track and commit changes to persist changes over post backs.
    <telerik:RadComboBox ID="RadComboBox1" runat="server" CheckBoxes="true">
                  <telerik:RadComboBoxItem runat="server" Text="Item 1" Value="1" />
                  <telerik:RadComboBoxItem runat="server" Text="Item 2" Value="2" />
                  <telerik:RadComboBoxItem runat="server" Text="Item 3" Value="3" />
          <telerik:RadComboBox ID="RadComboBox2" runat="server"></telerik:RadComboBox>
          <input id="Button1" type="button" value="Add checked items" onclick="AddItems()" />

    Hristo Valyavicharski
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top