This is a migrated thread and some comments may be shown as answers.

Item Remains Highlighted

2 Answers 47 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Bruce
Top achievements
Rank 1
Bruce asked on 04 Jan 2013, 02:10 PM
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 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Jan 2013, 06:31 AM
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.
0
Bruce
Top achievements
Rank 1
answered on 07 Jan 2013, 05:15 PM
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.
Tags
ListBox
Asked by
Bruce
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Bruce
Top achievements
Rank 1
Share this question
or