Problem with Transfer to multiple RadListBoxes using Drag and Drop

6 posts, 0 answers
  1. Anil
    Anil avatar
    12 posts
    Member since:
    Dec 2010

    Posted 26 Sep 2011 Link to this post

    Hi,
    I am using "Transfer to multiple RadListBoxes using Drag and Drop" feature. I got a jQuery function from Telerik team for this.

    After implementing this i am not able to get the transfered listbox item either in client side or in serverside.

    How can i get the selected/checked items from any of the listboxes?
  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 29 Sep 2011 Link to this post

    Hi Anil,

    Could you please provide me a sample project that reproduces your issue? Also clarify which version of our controls you are using.

    I tested the following project with the latest version of our controls and everything works fine on my side.

    All the best,
    Peter Filipov
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ammar
    Ammar avatar
    6 posts
    Member since:
    Sep 2011

    Posted 21 Oct 2011 Link to this post

    The values of the RadListBox items can't be accessed from server side.
    Do you have a suggestion for that?
  5. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 25 Oct 2011 Link to this post

    Hello Ammar,

    To access the transferred items you need the mark them into the client state of the RadListBoxes as transferred. Please review the following help article for more info.

    Kind regards,
    Peter Filipov
    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
  6. Ammar
    Ammar avatar
    6 posts
    Member since:
    Sep 2011

    Posted 25 Oct 2011 Link to this post

    thanks Peter i ended up solving that from the client side with hidden fields here is the client side script that i used:

    function getlistboxesvalues() {  

    //to do get the value of the items  

     

    var arr1 = new String();   

    var arr2 = new String();

    var arr3 = new String();

     var arrR1 = $find('<%= RadListBox3.ClientID %>');

     var arrR2 = $find('<%= RadListBox4.ClientID %>');

    var arrR3 = $find('<%= RadListBox5.ClientID %>');

     
    var arrR1Items = arrR1.get_items();

    var arrR2Items = arrR2.get_items();

    var arrR3Items = arrR3.get_items();

     

    var ar1 = document.getElementById('hdnField1');

    var ar2 = document.getElementById('hdnField2');

    var ar3 = document.getElementById('hdnField3');

     

     for (var i = 0; i < arrR1Items.get_count(); i++)

     {

          if (arrR1Items.getItem(i)._text != "")

          {

            arr1 += arrR1Items.getItem(i)._text;

         if (arrR1Items.get_count() > i+1)

         {

              arr1 += '|';

         }

     }

     for (var i = 0; i < arrR2Items.get_count(); i++)

     {

             if (arrR2Items.getItem(i)._text != ""
            {

                arr2 += arrR2Items.getItem(i)._text ;

             }

     

        if (arrR2Items.get_count() > i +1)

             {

                arr2 +='|'
            }

      }

     

     

     

    for (var i = 0; i < arrR3Items.get_count(); i++)

     

    {

             if (arrR3Items.getItem(i)._text != "")

            {

                arr3 += arrR3Items.getItem(i)._text ;

            } 

     

        if (arrR3Items.get_count() > i +1)

             {

                arr3 += '|';

              }

    }

     

    ar1.value = arr1;

    ar2.value = arr2;

    ar3.value = arr3;

     

    }

    when the onClientClick event fires up you I’ll have all the values of the RadListBoxes in the hidden field ar1, ar2, ar3 and I can after that do whatever need to be done on the server side i know that this script could be optimized and I’m sure I’ll give it a try in the other way you mentioned.
    Thanks again.

     

  7. Rakesh
    Rakesh avatar
    1 posts
    Member since:
    Dec 2011

    Posted 07 Dec 2011 Link to this post

    I had the same problem,
    so when u add or remove the item from rad list box ,
    use track change function of rad list box  before inserting or removing then immediately after that use commit changes.
    Following is the example for the same which worked for me  : -
    Ex :- 
      -----> For Removing
                 function remove(list) {                                      
                        var items1 = list.get_items();
                        var item1 = list.get_selectedItem();
                        list.trackChanges();
                        items1.remove(item1);
                        list.commitChanges();
                    }

        ------> For Adding
                      function remove(list) {  
                           destination.trackChanges();
                           destination.get_items().insert(reorderIndex, item);
                           destination.commitChanges();
                          }

    Best Luck
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017