Drag item to node in tree view, do not add item as subnode

3 posts, 0 answers
  1. JDT
    JDT avatar
    45 posts
    Member since:
    Jul 2007

    Posted 07 Feb 2011 Link to this post

    Hi Telerik,

    We need to know how to drag and drop an item from a different control to a treeview node without having it create a new sub node.

    Root1
    -Sub1
    -Sub2

    For example if we drag a list of items to Sub1 we then have.

    Root1
    -Sub1
    --ControlName.ListName
    -Sub2

    We just want the item to be dropped into Sub1 and retain the same structure. In other words not have a new node added to the treeview on drop.
    (this is how it should look after drop)
    Root1
    -Sub1
    -Sub2

    Thank you in advance!

  2. JDT
    JDT avatar
    45 posts
    Member since:
    Jul 2007

    Posted 09 Feb 2011 Link to this post

    Don't know how I missed this in the documentation. I moved code out of the drag ended event into the previewdragended event. This allowed me to perform an action on drop and bypass adding a new node.

    private void radTreeView_PreviewDragEnded( object sender, RadTreeViewDragEndedEventArgs e )
    {
       e.Handled = true;
    }
  3. DevCraft banner
  4. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 10 Feb 2011 Link to this post

    Hello JDT,

    So, does everything works fine with this approach? You can also check out the RadDragAndDropManager and its events. Feel free to ask if you need further assistance.

    Greetings,
    Petar Mladenov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top