Scrolling problem in TreeListView when drag-and-drop enabled

7 posts, 1 answers
  1. Georg
    Georg avatar
    15 posts
    Member since:
    Nov 2007

    Posted 10 Jul 2019 Link to this post

    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. 

  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2298 posts

    Posted 11 Jul 2019 Link to this post

    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.
  3. Georg
    Georg avatar
    15 posts
    Member since:
    Nov 2007

    Posted 11 Jul 2019 in reply to Martin Ivanov Link to this post

    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.

     

     

  4. Georg
    Georg avatar
    15 posts
    Member since:
    Nov 2007

    Posted 11 Jul 2019 Link to this post

    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.
  5. Georg
    Georg avatar
    15 posts
    Member since:
    Nov 2007

    Posted 11 Jul 2019 Link to this post

    Martin,

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

    Regards,

    Georg

     

  6. Answer
    Martin Ivanov
    Admin
    Martin Ivanov avatar
    2298 posts

    Posted 16 Jul 2019 Link to this post

    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.
  7. Georg
    Georg avatar
    15 posts
    Member since:
    Nov 2007

    Posted 16 Jul 2019 in reply to Martin Ivanov Link to this post

    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.

     

Back to Top