We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Detect when a node is moved on a diagram

Hi

What is the correct event to trap when a node is moved?

Thanks




2 Replies

JM John McAteer February 8, 2011 08:50 PM UTC

I think I might have solved this...

trap EventSink_PinPointChanged()

then check node.PinPoint.X or .Y ?



BM Bala Murugan A.S Syncfusion Team February 16, 2011 09:06 AM UTC

Hi John,

Thanks for using Syncfusion Products.

You can detect a node when it moved on a diagram by using PinPointChanged() event and this event is fired both when we move and re-size the node. So we suggest your to check which tool is currently in active. If the active tool is Move tool the node is moved. Please refer the below code snippet to achieve this.

[C#]
Tool activeTool = this.diagram1.Controller.ActiveTool;
if (activeTool is MoveTool)
{
MessageBox.Show("Moved Node Name: "+node.Name +" PinPointX : "+node.PinPoint.X+"PinPointY : "+node.PinPoint.Y);
}


For your convenience, we have created a simple sample to demonstrate this and the same can be downloaded from the below link.
DetectMoveNode876857109.zip

Kindly try the above sample and let me know your concerns.

Regards,
Bala Murugan A.S


Loader.
Live Chat Icon For mobile
Up arrow icon