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

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

2 Answers 38 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
JDT
Top achievements
Rank 1
JDT asked on 07 Feb 2011, 10:23 PM
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 Answers, 1 is accepted

Sort by
0
JDT
Top achievements
Rank 1
answered on 09 Feb 2011, 11:52 PM

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;
}
0
Petar Mladenov
Telerik team
answered on 10 Feb 2011, 12:21 PM
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>>
Tags
TreeView
Asked by
JDT
Top achievements
Rank 1
Answers by
JDT
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or