Connector Index?

Is it possible to know the connector index when we connect one closed node to several closed node Or when several closed nodes are connected to one closed node? For instance, one rectangle is connected to one elipse and another shape,, here i would like to know which connector is leaving first from the rectangle and which one is leaving second. If know that the connector leaving first is connected to the ellipse, i would like to match the connector index that might be unique to the rectangle and the ellipse. Likewise, if the connector leaving second (from the rectangle node) is connected to the second shape, i would expect that there might be a sort of unique connector index linking tthe rectangle and the shape. I can get the connector names programatically But I am unable to know the index value like 0 is the one leaving first, 1 as the second,...n as last when we connect programatocally one object to many or many to one object

1 Reply

NG Naganathan Ganesh Babu Syncfusion Team April 20, 2018 11:22 AM UTC

Hi Allen, 
 
We suggest you to use Diagram’s “SentToBack()” method to send the nodes/connectors to last in the nodes collection while adding the connector in the model. Also please use Node’s EdgesEntering/EdgesLeaving properties to get the in/out edges (i.e. connectors) for the particular nodes.  
 
Please refer to the below code example and sample. 
 
Code example: 
 
[C#] 
 
private void ConnectNodes(Node parent, Node child) 
        { 
            OrgLineConnector line = new OrgLineConnector(Point.Empty, new Point(100, 100)); 
            parent.CentralPort.TryConnect(line.TailEndPoint); 
            child.CentralPort.TryConnect(line.HeadEndPoint); 
 
            diagram1.Model.AppendChild(line); 
            //It will send to Back the last added/selection node into the Model.Nodes collection... 
            diagram1.SendToBack(); 
        } 
Sample: 
 
 
Regards, 
 
Naganathan K G 


Loader.
Up arrow icon