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

Drag & Drop betrween treeview

4 Answers 29 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Gunasekaran
Top achievements
Rank 1
Gunasekaran asked on 30 Jan 2014, 05:22 AM
 I am developing an application in which I require drag drop between two tree which a condition that
1. When child node is dragged , it needs to check if the Parent Node for that child is present in the Target Treeview,
    if (present)
     // add the child within that parent node
    else
     // Add the parent node and then the child node.

4 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 03 Feb 2014, 06:37 PM
Hello Gunasekaran,

To achieve your requirement you could use our DragDropManager and the default drag and drop behavior of the RadTreeView. To enable the default behavior you will need to set the IsDragDropEnabled property of the RadTreeView to true. You could try handling the OnDragOver and the OnDrop events to accomplish your demand.
DragDropManager.AddDragOverHandler(this.RightTree, OnDragOver, true);
DragDropManager.AddDropHandler(this.RightTree, OnDrop, true);

If you have difficulties in the implementation of this behavior, please let us know.

Regards,
Martin Ivanov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Gunasekaran
Top achievements
Rank 1
answered on 04 Feb 2014, 04:43 AM
hi Martin Ivanov ,

Thanks for your post , can you please provide a sample solution for it
0
Martin Ivanov
Telerik team
answered on 04 Feb 2014, 04:32 PM
Hi Gunasekaran,

I attached a sample project to demonstrate my suggestion. I hope it would be a good starting point for you. 

Regards,
Martin Ivanov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Gunasekaran
Top achievements
Rank 1
answered on 05 Feb 2014, 04:57 AM
hi Martin Ivanov,

Thank you so much for your quick responses.
This solution works exactly for my requirement ... Once again thanks for the solution
Tags
TreeView
Asked by
Gunasekaran
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Gunasekaran
Top achievements
Rank 1
Share this question
or