RadListBox

5 posts, 0 answers
  1. sandeep
    sandeep avatar
    17 posts
    Member since:
    May 2014

    Posted 22 Sep 2014 Link to this post

    How  to prevent  a particular item from left to right using code on server side or by using javascript on client side.

    Eg: If user want to move 'Argentina' from left to right,i want to prevent  and show an alert message saying  "It is not possible"  


               RoleSelectedListBox = new RadListBox();
                RoleSelectedListBox.ID = "RoleSelectedListBox";
                RoleSelectedListBox.TabIndex = 1;
                //RoleSelectedListBox.CssClass = "RoleSelectedListBoxStyle";
                RoleSelectedListBox.SelectionMode = ListBoxSelectionMode.Multiple;
                RoleSelectedListBox.AllowTransfer = true;
                RoleSelectedListBox.TransferToID = "RoleAvailableListBox";
                RoleSelectedListBox.Skin = "FuzeCustom";
                RoleSelectedListBox.EnableEmbeddedSkins = false;
                RoleSelectedListBox.EnableDragAndDrop = true;
                RoleSelectedListBox.EnableMarkMatches = true;
                RoleSelectedListBox.Sort = RadListBoxSort.Ascending;
                RoleSelectedListBox.SortItems(); 
  2. sandeep
    sandeep avatar
    17 posts
    Member since:
    May 2014

    Posted 22 Sep 2014 Link to this post

    Can any one help me to find the solution for this....please..
  3. DevCraft banner
  4. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 25 Sep 2014 Link to this post

    Hello,

    In order to achieve the desired functionality, you could use the OnClientTransferring client-side event. In the handler, you could verify the Source ListBox  (using get_sourceListBox().get_id() ) and the item, which is currently about to be transfer. If the item's text is Argentina, you could use the args.set_cancel(true) function to cancel the transfer.
    I have prepared as sample example for you, demonstrating the implementation of the above suggestion.


    Regards,
    Nencho
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. sandeep
    sandeep avatar
    17 posts
    Member since:
    May 2014

    Posted 25 Sep 2014 in reply to Nencho Link to this post

    It is working fine when i am transferring single item from left to right,but when i am trying to transfer all items from left to right, except "Agentina",this is raising an alert even i specify the condition as like you mentioned in the attachment...
  6. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 29 Sep 2014 Link to this post

    Hello,

    In case of a multiple transfer, I would suggest you to implement the approach, demonstrated in the following documentation article :

    http://www.telerik.com/help/aspnet-ajax/listbox-how-to-transfer-specific-items-with-transferall-button.html

    Basically, you would need to cancel the entire Transferring event and manually transfer the items, that meet the needed requirements for transfer.

    Regards,
    Nencho
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
DevCraft banner