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

Connector Disconnects from node

Is there an event that is fired when a connection between a connector and a node is made or broken?


4 Replies

AA Amsath Ali M Syncfusion Team September 28, 2011 04:34 AM UTC

Hi John,

Thanks for your interest in Syncfusion products.

We suggest you to use the Diagarm.Model.EventSink’s “ConnectionChanged/Changing” event to detect whether a connection between the nodes is made or broken. Please refer the below code to achieve your requirement.

Here is the code:
[C#]
//ConnectionChanged event
diagram1.Model.EventSink.ConnectionsChanged += new CollectionExEventHandler(EventSink_ConnectionsChanged);
void EventSink_ConnectionsChanged(CollectionExEventArgs evtArgs)
{
if (evtArgs.ChangeType == CollectionExChangeType.Insert)
{
MessageBox.Show("Nodes Connected");
}
if (evtArgs.ChangeType == CollectionExChangeType.Remove)
{
MessageBox.Show("Nodes Disconnected");
}
}

For your convenience, we have created a simple sample to achieve your requirement.
Please try the below sample and let us know if you have any queries.
Forum ConnectionChnaged-2090508724.zip

Regards,
Amsath Ali. M




JG John Guarino September 28, 2011 04:04 PM UTC

Thank you for the example. However, if you delete one of the rectangles, the change event does not fire. Further help is appreciated.



JG John Guarino September 28, 2011 04:04 PM UTC

Thank you for the example. However, if you delete one of the rectangles, the change event does not fire. Further help is appreciated.



AA Amsath Ali M Syncfusion Team September 29, 2011 01:55 PM UTC

Hi John,

Thanks for the update.

Since you have requested the same query in the Direct Trac incident 85492, we have updated the incident with necessary details. Please refer that incident for better follow up.

Please let us know if you have any queries.

Regards,
Amsath Ali. M



Loader.
Live Chat Icon For mobile
Up arrow icon