Drag & Drop between Treeviews

6 posts, 1 answers
  1. Denis
    Denis avatar
    12 posts
    Member since:
    May 2008

    Posted 05 Sep 2008 Link to this post

    Hi,

    Your documentation mentions being able to drag & drop between multiple treeviews.

    Is there a way to achieve that in the current release? It seems like the drag operation is limited to inside the control's area. The dragged item will stops moving once the cursor gets out of the treeview's region.

    Is there a property needed to activate that, or is this a limitation of the current release ?
  2. Answer
    Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 05 Sep 2008 Link to this post

    Hello Denis,

    this is a limitation that will we try to address in the next release.

    Thanks for your interest on this. We are actually working on a drag/drop framework which will allow drag/drop from/to any element.


    Sincerely yours,
    Valentin.Stoychev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Mahima
    Mahima avatar
    7 posts
    Member since:
    Nov 2008

    Posted 05 Dec 2008 Link to this post

    Hi,

    Can anyone update on whether the drag & drop across the treeviews is now possible or not?
    Is there any direct property/method that can be used to achieve this or is the behavior customizable?
    Please provide a sample if anyone has already worked on this.

    -Mahima
  4. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 09 Dec 2008 Link to this post

    Hello Mahima,

    The RadTreeView has simple built-in DragDrop that works automatically. If you want to implement Drag-Drop between different controls (as in your case), you need to use the DragDropManager.

    It uses extensively routed events and can be used with almost any control.

    I created a sample solution where Drag & Drop between TreeViews is implemented.

    The project also demosntrates TemplateSelectors and Binding, also DragDrop between DataGrid & tree view. These concepts are discussed here:

    http://www.telerik.com/community/forums/silverlight/treeview/databind-from-wcf.aspx

    and

    http://www.telerik.com/community/forums/silverlight/drag-and-drop/drop-to-a-datagridrow.aspx

    Also in the last thread I have attached a draft version of the DragDrop help which you can use.

    Please, let me know if you need more help.

    Regards,

    Miroslav
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Mike Gold
    Mike Gold avatar
    16 posts
    Member since:
    Oct 2009

    Posted 21 Dec 2009 Link to this post

    Hi Telerik,

    Is there a way to drag from one treeview to another and not remove the item from the source treeview (sort of like how microsoft does it with a "link" reference.  I couldn't figure out how to prevent the source tree from removing the item.  The end result should be both trees referencing the same object.

    best,

    -Mike Gold
    Microsoft MVP
  6. Mike Gold
    Mike Gold avatar
    16 posts
    Member since:
    Oct 2009

    Posted 21 Dec 2009 Link to this post

    Hi Telerik,

    Just found the answer in this forum. 
    best,

    -Mike

    You can handle the PreviewDragEnded event, like so:

    private void treeView_PreviewDragEnded(object sender, RadTreeViewDragEndedEventArgs e)
    {
        e.Handled = true;
    }

    This will make sure that the tree view does not modify its data source.

    Kind regards,
    Miroslav
    the Telerik team
Back to Top