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
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
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.
Martin,
If I set AllowCapturedDrag="False" (and leave AllowDrag="True") the scrolling works fine.
Regards,
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
>
I hope this helps.
Regards,
Martin Ivanov
Progress Telerik
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.