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

Scrolling problem in TreeListView when drag-and-drop enabled

6 Answers 81 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Georg
Top achievements
Rank 1
Veteran
Georg asked on 10 Jul 2019, 01:44 PM

In your standard TreeListView sample program, ExpandItemsIntoView, scrolling stops working if I add drag-and-drop parameters as follows:

        <telerik:RadTreeListView x:Name="RadTreeListView1" 

                                 GroupRenderMode="Flat" 
                                 ItemsSource="{Binding}" 
                                 Grid.Row="1"
                                 telerik:DragDropManager.AllowDrag="True"
                                 telerik:DragDropManager.AllowCapturedDrag="True">

Is that a problem with the control, or is something else needed to ensure scrolling works? I have this problem in a much more complex example, but I was able to reproduce it in your sample. 

6 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 11 Jul 2019, 02:57 PM
Hello Georg,

I've tested this but, I wasn't able to reproduce it. Can you please test the attached project and let me know if I am missing something?

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Georg
Top achievements
Rank 1
Veteran
answered on 11 Jul 2019, 03:34 PM

Thanks Martin. When I run your example, I get the scrolling problem. I'm using "C:\Program Files (x86)\Telerik\UI for WPF Q2 2016\Binaries\WPF40", so maybe I just need to update to a more recent version. I'll try that.

 

 

0
Georg
Top achievements
Rank 1
Veteran
answered on 11 Jul 2019, 03:54 PM
Unfortunately, upgrading to the latest version did not fix the problem. In the example, the vertical slider bar appears, and clicking the little arrows at the top and bottom work fine, but dragging the main slider with the mouse doesn't work very well. It only moves a little at a time. If you remove the drag-and-drop parameters it works fine though.
0
Georg
Top achievements
Rank 1
Veteran
answered on 11 Jul 2019, 04:00 PM

Martin,

If I set AllowCapturedDrag="False" (and leave AllowDrag="True") the scrolling works fine.

Regards,

Georg

 

0
Accepted
Martin Ivanov
Telerik team
answered on 16 Jul 2019, 09:25 AM
Hello Georg,

It seems that I've misunderstood the issue. If I drag the vertical scrollbar I also cannot scroll properly. This happens because when you allow dragging the DragDropManager is subscribing the control for some drag events that interfere with the dragging of the scrollbar. You can resolve this by using the AllowDrag property, instead of AllowCapturedDrag, as you already found. 

Also, can you tell me why do you need to set the AllowDrag property on the RadTreeListView itself? Usually, the property is set on the child elements of the control to allow them to be dragable. Which means that setting the property to True for a specific element tells the DragDropManager that its events can be fired for this specific element. If you want to drag/drop rows, you can set the AllowDrag on the TreeListViewRow elements via the RowStyle property. 
<telerik:RadTreeListView.RowStyle>
    <Style TargetType="telerik:TreeListViewRow">
        <Setter Property="telerik:DragDropManager.AllowDrag" Value="True" />
    </Style>
</telerik:RadTreeListView.RowStyle>
And then implement a custom drag/drop functionality using DragDropManager, as shown in the "Drag and Drop" demo.

I hope this helps.

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Georg
Top achievements
Rank 1
Veteran
answered on 16 Jul 2019, 02:12 PM

Thanks Martin. Our drag-and-drop code was implemented by a previous developer, so I'm not sure why he implemented it that way. I'll fix it as you suggested though.

 

Tags
TreeListView
Asked by
Georg
Top achievements
Rank 1
Veteran
Answers by
Martin Ivanov
Telerik team
Georg
Top achievements
Rank 1
Veteran
Share this question
or