Hi,
Sorry for the inconvenience. The event was actually "NodeCollectionChanged" not the one mentioned in the previous section. Here's the code snippet for your queries,
-> When a node is deleted what event is raised??
Please use the following code snippet for checking if any node/connector/other objects related to nodes are changed in the node collection. Use the "ChangeType" enum value to identify the type of change.
void EventSink_NodeCollectionChanged(CollectionExEventArgs evtArgs)
{
if (evtArgs.ChangeType == CollectionExChangeType.Remove && evtArgs.Element is LineConnector)
{
MessageBox.Show("removed");
LineConnector conn = evtArgs.Element as LineConnector;
MessageBox.Show("From node is " + conn.FromNode.ToString());
MessageBox.Show("To node is " + conn.ToNode.ToString());
}
else if (evtArgs.ChangeType == CollectionExChangeType.Insert && evtArgs.Element is Node)
{
MessageBox.Show(((Node)evtArgs.Element).Name);
}
}
-> Need to know which node is connected to which link.
This can be resolved by getting the connector object and then accessing the "FromNode" and "ToNode" properties, to know which node is connected.
Please refer to the below link which illustrates for the above queries,
http://websamples.syncfusion.com/samples/Diagram.Windows/F67558/main.htmPlease let me know if this helps you out.
Thanks,
Fahad