Item Remains Highlighted

3 posts, 0 answers
  1. Bruce
    Bruce avatar
    17 posts
    Member since:
    Oct 2010

    Posted 04 Jan 2013 Link to this post

    I am using paired ListBox objects.  When an item is transferred from one to the other, the item row where the transferred item is moved from remains highlighted.  Assume three items in the left ListBox and none in the right.  Click on the top item in the left list box and transfer it to the right.  The result is two items in the left ListBox and one in the right, as expected.  What is unexpected is that the top item in the left ListBox is now highlighted.  I have tried to address the issue in the OnClientTransferred handler with the following:

     sourceBox.clearSelection();
    destinationBox.clearSelection();
    for (i = 0; i < sourceBox.get_items().get_count(); i++)
    {
            var item = sourceBox.getItem(i);
            item.unselect();
            item._unhighlight();
    }

    That did not resolve the issue.  The following is the tag used to declare the RadListBox:

    <telerik:RadListBox ID="lstUnassignedSecurity" runat="server" Width="210px" Height="150px" AutoPostBack="false" 
    SelectionMode="Multiple" AllowTransfer="true" TransferToID="lstAssignedSecurity" AutoPostBackOnTransfer="False"
    EnableDragAndDrop="true" OnClientTransferred="listTransferring" ButtonSettings-ShowTransferAll="false">
        <Items>
        </Items>
    </telerik:RadListBox>.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Jan 2013 Link to this post

    Hi Bruce,

    Try the following code snippet to achieve your scenario.

    JS:
    <script type="text/javascript">
        function OnClientTransferred(sender, args) {
            setTimeout(function () { sender.clearSelection(); }, 100);
        }
    </script>

    Hope this helps.

    Regards,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bruce
    Bruce avatar
    17 posts
    Member since:
    Oct 2010

    Posted 07 Jan 2013 Link to this post

    That did the trick.  I'll assume the introduction of a delay means that a highlighting/selection function of some sort is performed later in the call stack (no need to reply).

    Thanks.
Back to Top