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

Drag and Drop *onto* RadTreeViewItem

2 Answers 65 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Matt Kalinowski
Top achievements
Rank 1
Matt Kalinowski asked on 28 Jun 2010, 04:57 PM

Hello,

I'm attempting to drag one RadTreeViewItem from one RadTreeView *onto* another RadTreeViewItem in another RadTreeView.  I can drag/drop under/above the mode perfectly fine, but what I'd really like to do is drag/drop on top of the receiving node (because I have a custom Item Container for each, it is more intuitive with the design to drop on top of instead of just above/below).  I have tried messing with AllowDrop (both in the main control and the ItemContainer data template) and catching the DropInfo and DropQuery events, but no luck so far.  I would imagine this is technically possible to do, but I haven't found a good solution yet.  Any help would be greatly appreciated.

Thanks!

2 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 01 Jul 2010, 05:38 PM
Hi Matt Kalinowski,

I am not sure what exactly is your scenario. So I cannot be entirely sure what is causing the issue.

However, if you have a hierarchy of Companies for example. And each company has a collection of Departments, where for every department is defined a collection of employees. Now in this scenario, if you create two trees displaying such hierarchies, you will notice that you will only be able to drop employees into departments and departments into companies. In other words if the destination data item doesn't contain a collection of items, which type is the same as the type of the dragged item, then the drop operation is not allowed.

If your case is similar, you will need to make sure that the definition of the items that you want to drop onto allow the operation.

I prepared a sample project illustrating this scenario. In the example all data items inherit one common class thus allowing all "drop onto" operations between and inside the trees.

Please take a look at the project and let me know if it helps. Also if your scenario requires a different approach, can you please elaborate on it. Thank you in advance.

Regards,
Tina Stancheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
FantasmaWeb
Top achievements
Rank 1
answered on 03 Oct 2011, 11:37 PM
Hello....

    I have some problem, cause I want to make the drag and drop between two Trees, but I want to  make some restric, so I Used the

RadDragAndDropManager , but the DropQuery event doesn't fire, my tow trees have the property IsDragDropEnabled="True" 

   Regards

 

 

 

Tags
DragAndDrop
Asked by
Matt Kalinowski
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
FantasmaWeb
Top achievements
Rank 1
Share this question
or