RADListBox transfer grouped item.

2 posts, 0 answers
  1. Anthony
    Anthony avatar
    1 posts
    Member since:
    Dec 2011

    Posted 03 Jan 2012 Link to this post

    When I use the RADListBox with grouped items. Everything displays correctly until I perform a client side transfer from one listbox to another. The transfered items append to the bottom of the listbox and are not grouped. How can I transfer and have everything regroup client side.

    <script type="text/javascript">

            function onClientTransferred(sender, args) {

                //alert("transfer from id:" + args.get_sourceListBox().get_id());
                //alert("transfer to id:" + args.get_destinationListBox().get_id());

                var fromList = args.get_sourceListBox().get_items();
                var fromItem = args.get_item();
                var fromItemAttributes = args.get_item().get_attributes();
                var fromItemCat = fromItemAttributes.getAttribute("DataGroupField");
                alert("from item cat:" + fromItemCat);

                var toList = args.get_destinationListBox().get_items();
                var toItem = args.get_destinationListBox().findItemByValue(args.get_item().get_value());
                var toItemAttributes = toItem.get_attributes();
                toItemAttributes.setAttribute("DataGroupField", fromItemCat);
                toItem.attributes = toItemAttributes;

                var index = fromList.indexOf(toItem);
                toList.insert(index, toItem);

                alert("to item:" + toItem.get_text());


    <rei:REIRadListBox ID="lstFavItems" runat="server" AllowTransfer="true" TransferToID="lstTopFavItems" EnableDragAndDrop="true" EnableEmbeddedSkins="false"  DataTextField="DisplayText" DataValueField="UserFavoriteId" SelectionMode="Multiple" EnableFiltering="true" FilterBoxEmptyMessage="Type here to filter" Height="200" Width="370" 
    TransferMode="Move"  OnTransferred="RadListBox_Transferred" AllowReorder="true"  OnClientTransferred="onClientTransferred"  />

    <rei:REIRadListBox ID="lstTopFavItems" runat="server" Height="200" Width="370" EnableDragAndDrop="true" EnableFiltering="true" EnableEmbeddedSkins="false" FilterBoxEmptyMessage="Type here to filter" 
    DataTextField="DisplayText" DataValueField="UserFavoriteId"  AllowReorder="true" />
  2. Dimitar Terziev
    Dimitar Terziev avatar
    1268 posts

    Posted 04 Jan 2012 Link to this post

    Hi Anthony,

    I've inspected the code snippets provided and as it appears you are grouping your items based on some attributes. The important part here is that you are adding the transferred item on a specific index in the items collection of the destination ListBox and it shouldn't be show at the bottom of the list as you have described.

    In order to troubleshoot this issue, please open a support ticket and provide a runnable sample page demonstrating the issue so I could debug it locally.

    Dimitar Terziev
    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