Sorting using drag drop

2 posts, 0 answers
  1. Toby
    Toby avatar
    8 posts
    Member since:
    Oct 2017

    Posted 23 Jan 2018 Link to this post

    Hi, I have a single tree list which contains several top level nodes, each node has multiple children. What I want to do is to only allow movement of nodes within only within the list of sibling nodes.

    The effect that I'm after is something similar to the first animation in https://stackoverflow.com/questions/45838579/separator-line-drag-drop-tree-nodes-c-sharp-winforms.

    I have set my tree view AllowDragDrop to true and this allows me to move items around however it is possible to move an existing into a sibling node and generate a sub-tree.

    Is this possible and if so, how ? Also is it possible to override the drawing of the "insertion point" ?

    Regards

    Toby

     

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3224 posts

    Posted 24 Jan 2018 Link to this post

    Hello, Toby,

    Thank you for writing.  

    RadTreeView handles the whole drag and drop operation by its TreeViewDragDropService. As a descendant of RadDragDropService, TreeViewDragDropService handles the whole drag and drop operation. The PreviewDragOver event allows you to control on what targets the node element being dragged can be dropped on. The PreviewDragDrop event allows you to get a handle on all the aspects of the drag and drop operation, the source (drag) tree view, the destination (target) control, as well as the node being dragged. This is where we will initiate the actual physical move of the node(s) from one tree view to the target control. An alternative approach of handling the mentioned events is to override the relevant methods of the service. A sample implementation is demonstrated in the Modify the DragDropService behavior help article.

    I hope this information helps. Should you have further questions I would be glad to help. 
     
     Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top