This is a migrated thread and some comments may be shown as answers.
Drag-Drop Reorder Multiple Selection Issue
4 Answers 7 Views
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 29 Oct 2020, 04:11 PM

Hello,

I am having an issue with reordering multiple selected items in a RadListBox. I am trying to select multiple items in a RadListBox, and drag them within the same RadListBox to reorder them. However, it doesn't always work. When I start to drag, sometimes I will be able to reorder the items (cursor indicator and drop visual indicator in the RadListBox show normally), and sometimes it won't. The drag visual always works normally, but it looks like AllowDrop is immediately false sometimes (not sure if that is what is actually happening, but it's the best way I can describe it). I have a test RadListBox for theme visual feedback and testing, and the behavior is happening there. Here is the code I am using:

<telerik:RadListBox SelectionMode="Extended">
    <telerik:RadListBoxItem Content="Item 1"
                    Style="{DynamicResource ReorderableListItemStyle}"/>
    <telerik:RadListBoxItem Content="Item 2"
                    Style="{DynamicResource ReorderableListItemStyle}"/>
    <telerik:RadListBoxItem Content="Item 3"
                    Style="{DynamicResource ReorderableListItemStyle}"/>
    <telerik:RadListBoxItem Content="Item 4"
                    Style="{DynamicResource ReorderableListItemStyle}"/>
    <telerik:RadListBoxItem Content="Item 5"
                    Style="{DynamicResource ReorderableListItemStyle}"/>
    <telerik:RadListBoxItem Content="Item 6"
                    Style="{DynamicResource ReorderableListItemStyle}"/>
    <telerik:RadListBoxItem Content="Item 7"
                    Style="{DynamicResource ReorderableListItemStyle}"/>
    <telerik:RadListBoxItem Content="Item 8"
                    Style="{DynamicResource ReorderableListItemStyle}"/>
    <telerik:RadListBox.DragDropBehavior>
        <telerik:ListBoxDragDropBehavior/>
    </telerik:RadListBox.DragDropBehavior>
</telerik:RadListBox>

 

And here is the code for ReorderableListItemStyle:

<Style x:Key="ReorderableListItemStyle"
    TargetType="telerik:RadListBoxItem"
    BasedOn="{StaticResource RadListBoxItemStyle}">
    <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" />
</Style>

 

Is there something I am missing? I am using Telerik WPF R3 2020.

4 Answers, 1 is accepted

Sort by
0
Dinko
Telerik team
answered on 03 Nov 2020, 09:16 AM

Hi Daniel,

Thank you for the provided code snippet.

I have run a few tests, but I wasn't able to observe the described behavior. I have used the code snippet from your post for testing purposes. Is it possible to create a video that shows the steps and this behavior? This way, I can try to follow them on my side to reproduce it. 

I am looking forward to your reply.

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products, quickly just got a fresh new look + new and improved content, including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Daniel
Top achievements
Rank 1
answered on 03 Nov 2020, 01:30 PM

Hello Dinko,

Thanks for replying. I have included a link to a video below. It is the same RadListBox mentioned above, and I am using Ctrl + Click to select multiple items, then trying to drag them to reorder. The color effects around the cursor are from the recording software. Let me know if you need anything else from me.

https://www.dropbox.com/s/bqp71cwxs0wv3nv/ListBoxForTelerik.mp4?dl=0

0
Daniel
Top achievements
Rank 1
answered on 03 Nov 2020, 02:11 PM
We found the issue. It turns out that when you select multiple items, Visual Studio places the debugger toolbar on the drag visual, and if you happen to mouse over that during the drag, it causes the issue mentioned.
0
Dinko
Telerik team
answered on 05 Nov 2020, 08:12 AM

Hello Daniel,

I am happy to hear that you have found a solution for your case, and thank you for sharing it. If you have any other questions, you can open a new thread with your questions inside, and we will be happy to help.

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products, quickly just got a fresh new look + new and improved content, including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Asked by
Daniel
Top achievements
Rank 1
Answers by
Dinko
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or