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

Tree View Drag Drop on certain nodes

6 Answers 78 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Brian Baker
Top achievements
Rank 1
Brian Baker asked on 10 Sep 2010, 09:44 PM
Hi,

I am using your Tree View control in my application.  I am also utlizling the drag drop feature which is pretty handy.

However, when I turn the drag/drop on it allow me to drag and drop an element on any node. 

How can I set it so that I can only drag and only drop elements from the lowest nodes on the tree view?

thanks

6 Answers, 1 is accepted

Sort by
0
Viktor Tsvetkov
Telerik team
answered on 15 Sep 2010, 05:47 PM
Hello Brian Baker,

Could you please examine the attached sample project and tell me if it works for you?

On a side note, I'd like to inform you that we've just released an online tool that allows you to reduce the size of your Silverlight applications. For more information, please visit http://blogs.telerik.com/blogs/posts/10-06-10/telerik_assembly_minifier.aspx

Sincerely yours,
Viktor Tsvetkov
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
Peter
Top achievements
Rank 1
answered on 24 Mar 2011, 09:50 PM
I would like to achieve similar result as Brian.
For example, I have two kinds of nodes   A, and B.
A is a parent node that contains a collection of B nodes.
I would like the RadTreeView to allow me to drag B nodes from a A node to another A node.

A nodes and B nodes are all in a collection that the ItemsSource of the RadTreeView binds to.
I also use a template selector so that it will generate RadTreeViewItem in the hierarchical order that I want.

I've followed the project that you posted to setup drag and drop, however, it does not work.
What I did were that I set the IsDragDropEnabled = true and added a PreviewDragEnded handler to the RadTreeView.

How can I achieve the result that I want?

Thanks

0
Petar Mladenov
Telerik team
answered on 30 Mar 2011, 11:18 AM
Hello Brian Baker,

I created a sample project for you that demonstrates a sample treeview showing Files and Folders that are "draggable". Could you please examine it and let me know if it helps you. It would be great if you could modify the projet and send it back to us in order to show the issue you have come up with. This way we could investigate it faster and provide you with a better advice. Thank you for your cooperation.

All the best,
Petar Mladenov
the Telerik team
0
Nagalaxmi
Top achievements
Rank 1
answered on 18 Apr 2011, 08:20 PM
I am facing the similar problem.
I have various types of parent nodes and i want to check the node where the dragged item is getting dropped and based on that i want to restrict the drop.
I tried the event 'PreviewDragEnded' but there I am able to catch the dragged item using the property e.tragetdropitem where as I want to get the item on which I am dropping the nodes. So that I can check the type of the parent and put my rules for dropping the node.....:(
Any guidance.....
1. Is there any property or event I am missing where I can catch the node on which I am dropping the dragged items.
2. Is there any work around or sample links where I can refer for getting this functionality.

Thanks in advance for all the help,
Laxmi

 
0
Petar Mladenov
Telerik team
answered on 21 Apr 2011, 03:50 PM
Hello Brian Baker,

From your explanation, I was unable to understand why you can't use this event. You are able to use e.TargetDropItem and e.Draggeditems in order to check the drag and drop compatibility between the source item(s)`s and target item`s  (or its parent type).If the source and the tagrget are not compatible, you can set e.Handled = true and the drop operation will be prevented. Could you please elaborate more on your scenario if this does not satisfies you? You can also check out this help article.

All the best,
Petar Mladenov
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
Nagalaxmi
Top achievements
Rank 1
answered on 21 Apr 2011, 07:21 PM
Thank you Brian......
I was able to resolve it .
Laxmi
Tags
TreeView
Asked by
Brian Baker
Top achievements
Rank 1
Answers by
Viktor Tsvetkov
Telerik team
Peter
Top achievements
Rank 1
Petar Mladenov
Telerik team
Nagalaxmi
Top achievements
Rank 1
Share this question
or