Hi Won,
Thanks for using Syncfusion Products.
We suggest you to disable the DefaultContextMenu and create a desired context menu in order to achieve your requirement. We have attached a sample for your reference.
Here is the Code Snippet:
//To disable the DefaultContextMenu
this.diagram2.DefaultContextMenuEnabled = false;
//Creation of Context Menu
System.Windows.Forms.ContextMenu cvp = new System.Windows.Forms.ContextMenu();
cvp.MenuItems.Add("Copy");
//Event while clicking the context menu item
cvp.MenuItems[0].Click += Form1_Click;
diagram2.ContextMenu = cvp;
//Rendering the Mouse Click event
diagram2.MouseClick+=diagram2_MouseClick;
//Capturing the node
void Form1_Click(object sender, EventArgs e)
{
diagram2.Controller.Copy();
IDataObject clipboardData = Clipboard.GetDataObject();
ClipboardNodeCollection c = (ClipboardNodeCollection)clipboardData.GetData(typeof(ClipboardNodeCollection));
NodeCollection nodes = c as NodeCollection;
foreach (Node n in nodes)
{
Sel_Node = n;
Sel_Node.PinPoint = new Point(100, 100);
diagram2.Model.AppendChild(Sel_Node);
}
}
Here is the Sample:
Sample
Please let us know if any concerns.
Regards,
Swarnesh K