Bulk InsertItems into Listbox

2 posts, 0 answers
  1. Dan
    Dan avatar
    15 posts
    Member since:
    Jul 2010

    Posted 18 Mar 2011 Link to this post

    I am trying to do a bulk insert items from one radlistbox to another radlistbox.  In my javascript code, I am getting all the checkeditems from the first listbox (which returns an array) and trying to insert them into the destination (provision) listbox.

     function SetProvisions(RadListBoxArray) {

             var RadListBoxCount = RadListBoxArray.length;
             var i = 0;
             var ProvisionListBox = $find("<%= uxProvisions.ClientID %>");

             for (i = 0; i < RadListBoxCount; i++) {
                 var RadListBox = RadListBoxArray[i];
                 var RadListBoxCheckedItems = RadListBox.get_checkedItems();
                 ProvisionListBox.insertItems(RadListBoxCheckedItems);       <<<<Getting error here


    Getting error stating that "Array of RadListBox items or Telerik.Web.UI.RadListBoxItem collection should be passed."

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Mar 2011 Link to this post

    Hello dan,

    From the error I assume that "RadListBoxCheckedItems"  is not a collection of RadListItems. Could you check whether it retrieves RadListBoxItems collection?

    The "insertItems" method worked perfectly in my end when I passed RadListBoxItems array as parameter.

Back to Top