Drag Drop from TreeViewAdv to EditControl

I was wondering how to drag and drop from a TreeViewAdv control to an EditControl. I currently have the EditControl set to allow file drop. What else do I need to do?

2 Replies

JJ Jisha Joy Syncfusion Team September 13, 2007 12:47 PM UTC

Hi Allie,

Drag and Drop of TreeViiewAdv nodes is possible by using the ItemDrag event of editcontrol.Below is the sample code snippet for your reference:

//ItemDrag EventHandler
private void treeViewAdv1_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e)
{

TreeViewAdv treeViewAdv = (TreeViewAdv)sender;
TreeNodeAdv[] nodes = (TreeNodeAdv[])e.Item;
TreeNodeAdv node = nodes[0];
this.treeViewAdv1.DoDragDrop(node.Text, DragDropEffects.All);

}

Please refer to the attached sample that illustrates the same:
http://websamples.syncfusion.com/samples/Tools.Windows/F68190/main.htm

Please try with the above details and let me know if you have any questions.

Regards,
Jisha


AL Allie September 13, 2007 08:10 PM UTC

That works, thank you!

Loader.
Up arrow icon