Sorting items in a RadListBox

1 Answer 129 Views
ListBox
Johnny
Top achievements
Rank 3
Bronze
Iron
Iron
Johnny asked on 25 Aug 2022, 08:11 AM

Hello everyone!

 

I have 2 listboxes where I am transferring data from one to another. You may check the attached screenshot for a better understanding of my page's layout.

The page contains a combobox and 2 listboxes.The combobox allows you to select a user from the list and then both listboxes will display the permissions this user has (on the left) and the perms he doesn't have (on the right). All of it is automatic of course and connected to a database.

Moving items from one listbox to another is messing with the order. I have tried to do the following:

Protected Sub RadListBoxSource_MM_Transferred(sender As Object, e As RadListBoxTransferredEventArgs) Handles RadListBoxSource_MM.Transferred
        SortRadListBoxes_MM
    End Sub

    Protected Sub RadListBoxDestination_MM_Transferred(sender As Object, e As RadListBoxTransferredEventArgs) Handles RadListBoxDestination_MM.Transferred
        SortRadListBoxes_MM()
    End Sub

    Private Sub SortRadListBoxes_MM()
        RadListBoxSource_MM.Sort = RadListBoxSort.Ascending
        RadListBoxSource_MM.SortItems()

        RadListBoxDestination_MM.Sort = RadListBoxSort.Ascending
        RadListBoxDestination_MM.SortItems()
    End Sub

This is not working, and the items are being added to the bottom of the list instead of being sorted to their correct position.

Thanks!

<telerik:RadListBox RenderMode="Lightweight" runat="server" ID="RadListBoxSource_MM" 
                        Height="200px" Width="100%" Skin="Material"
                        AllowTransfer="true" TransferToID="RadListBoxDestination_MM"
                        ButtonSettings-AreaWidth="35px">
</telerik:RadListBox>

<telerik:RadListBox RenderMode="Lightweight" runat="server" 
                    ID="RadListBoxDestination_MM" Height="200px" Width="100%"
                    ButtonSettings-AreaWidth="35px" Skin="Material">
</telerik:RadListBox>

 

1 Answer, 1 is accepted

Sort by
0
Johnny
Top achievements
Rank 3
Bronze
Iron
Iron
answered on 29 Aug 2022, 09:59 AM
Still need help with this one. Thanks!
Attila Antal
Telerik team
commented on 09 Feb 2023, 02:25 PM

Hi Johnny,

Thanks for reporting the issue.

Yes, the ListBox is suffering from the Sort functionality. We are aware of this as we have been working on it a few times in the past but we could not find any quick fixes/workarounds. The Issue is now available to the Public and can be tracked at SortOrder field update not consistent.

 

Tags
ListBox
Asked by
Johnny
Top achievements
Rank 3
Bronze
Iron
Iron
Answers by
Johnny
Top achievements
Rank 3
Bronze
Iron
Iron
Share this question
or