Drop position line stays after canceling D&D

2 posts, 1 answers
  1. Marcin
    Marcin avatar
    31 posts
    Member since:
    Jul 2013

    Posted 26 Sep 2014 Link to this post


    After migrating to latest Telerik silverlight controls, we encounter an D&D behavior, that was working correctly in previous version of D&D (legacy mode).

    In some scenarios a D&D operation is ended by setting e.Handled to true in PreviewDrop event. In such cases there is a modal dialog opened, so that the user can enter details for the D&D operation, and after accepting it a dragged node is placed in correct position.

    In this situation, the drop position line stays in the tree.

    Is there any way to remove it from the tree?

    Telerik version: 2014.2.729.1050

    Best regards
    Marcin Danek
  2. Answer
    Martin Ivanov
    Martin Ivanov avatar
    1444 posts

    Posted 29 Sep 2014 Link to this post

    Hi Marcin,

    The described behavior is caused by the fact that the internal drag drop logic of the tree updates the preview line in its Drop event handler. When you handle the PreviewDrop event, the logic for removing the line is not executed.

    In order to hide the line you can use the RadTreeView's UpdateDropPreviewLine() method.
    private void OnPreviewDrop(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
        e.Handled = true;
        this.tree.UpdateDropPreviewLine(null, DropPosition.Undefined);

    Please let me know if you need any further assistance.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top