This is a migrated thread and some comments may be shown as answers.

Drag & Drop between Treeviews

5 Answers 213 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Denis
Top achievements
Rank 1
Denis asked on 05 Sep 2008, 06:56 PM
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 ?

5 Answers, 1 is accepted

Sort by
0
Accepted
Valentin.Stoychev
Telerik team
answered on 05 Sep 2008, 07:06 PM
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.
0
Mahima
Top achievements
Rank 1
answered on 05 Dec 2008, 11:29 AM
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
0
Miroslav
Telerik team
answered on 09 Dec 2008, 12:12 PM

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.
0
Mike Gold
Top achievements
Rank 1
answered on 21 Dec 2009, 10:45 PM
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
0
Mike Gold
Top achievements
Rank 1
answered on 21 Dec 2009, 10:55 PM
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
Tags
TreeView
Asked by
Denis
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Mahima
Top achievements
Rank 1
Miroslav
Telerik team
Mike Gold
Top achievements
Rank 1
Share this question
or