Hi GA,
If you want to fire a event when you drag and drop a node on the existing node then you can write a delegate. Please refer to the following code snippet
public delegate void NodeDragDrop(object sender, EventArgs e);
public event NodeDragDrop nodedragdrop;
public Form1()
{
InitializeComponent();
this.nodedragdrop += new NodeDragDrop(Form1_nodedragdrop);
}
private void diagram1_DragDrop(object sender, DragEventArgs e)
{
if(e.Data.GetDataPresent(typeof(TreeNode)))
{
TreeNode treenode = (TreeNode) e.Data.GetData(typeof(TreeNode));
TextNode textnode = new TextNode(treenode.Text);
textnode.SizeToText(new SizeF(0,0));
textnode.PinPoint = pt;
this.diagram1.Model.AppendChild(textnode);
this.diagram1.Refresh();
if (symbol2.BoundingRectangle.IntersectsWith(textnode.BoundingRectangle))
{
this.nodedragdrop(sender, e);
}
}
}
I have attached the sample that demonstrates this completely. You can download the sample from the following page.
http://websamples.syncfusion.com/samples/Diagram.Windows/F65640/main.htmPlease let me know if you have any questions.
Thanks,
Nagaraj