Tree View Drag Drop on certain nodes

7 posts, 0 answers
  1. Brian Baker
    Brian Baker avatar
    10 posts
    Member since:
    Mar 2010

    Posted 10 Sep 2010 Link to this post

    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
  2. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 15 Sep 2010 Link to this post

    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
  3. DevCraft banner
  4. Peter
    Peter avatar
    10 posts
    Member since:
    Oct 2010

    Posted 24 Mar 2011 Link to this post

    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

  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 30 Mar 2011 Link to this post

    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
  6. Nagalaxmi
    Nagalaxmi avatar
    5 posts
    Member since:
    Jan 2011

    Posted 18 Apr 2011 Link to this post

    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

     
  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 21 Apr 2011 Link to this post

    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





















  8. Nagalaxmi
    Nagalaxmi avatar
    5 posts
    Member since:
    Jan 2011

    Posted 21 Apr 2011 Link to this post

    Thank you Brian......
    I was able to resolve it .
    Laxmi
Back to Top
DevCraft banner