Nodes connection information

I see that we can detect all nodes in the diagram as follows:

For Each node As Node In nodes
...
Next

But how can we find out the connection information, like which which filledpaths are connected together and by which connector?
Like for instance if we have 3 filledpath, I would like to show:
filledpath1 is connected to filledpath2 by connector1; 
filledpath2 is connected to filledpath3 by connector2

I would like to identify the name of the nodes that are already on the diagram page, find out which which node is connected to which node and by which connector



2 Replies

NG Naganathan Ganesh Babu Syncfusion Team January 16, 2018 04:55 AM UTC

Hi Allen,   
Please confirm us whether your requirement is to find the connected nodes? If so, we suggest you to use below mentioned list of Node’s properties,  
 1.      Edges – it used to find all connected objects.  
 2.      EdgesEntering – it used to find the head end points of the connected objects alone.   
 3.      EdgesLeaving - it used to find the tail end points of the connected objects alone.   
We have created a sample as per your requirement of passing value to connected objects. Please refer to the below sample and video. Also, let us know if your requirement is achieved or not?  
Code example: 
[VB] 
 
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click 
            If diagram1.View.SelectionList.Count = 1 Then 
                Dim tonode As Node = TryCast(diagram1.View.SelectionList(0), Node) 
                Dim text As String = String.Empty 
                For Each con As ConnectorBase In tonode.Edges 
                    Dim node As Node = TryCast(con.ToNode, Node) 
                    If tonode.Equals(node) Then 
                        Continue For 
                    End If 
                    text += node.Name + Constants.vbLf + con.Name 
                Next con 
                MessageBox.Show(text) 
            End If 
        End Sub 
 Sample:  
 Sample  
 Video: 
Regards,  
Naganathan K G  
 



NG Naganathan Ganesh Babu Syncfusion Team January 16, 2018 04:57 AM UTC

Hi Allen,  
 
Please ignore our previous update. 
  
We suggest you to use below mentioned list of Node’s properties, to find the connected nodes and conncetors 
  
1.      Edges – it used to find all connected objects.  
2.      EdgesEntering – it used to find the head end points of the connected objects alone.   
3.      EdgesLeaving - it used to find the tail end points of the connected objects alone.   
  
Also, please refer to the below sample and video. Also, let us know if your requirement is achieved or not?  
 
Code example: 
 
[VB] 
 
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click 
            If diagram1.View.SelectionList.Count = 1 Then 
                Dim tonode As Node = TryCast(diagram1.View.SelectionList(0), Node) 
                Dim text As String = String.Empty 
                For Each con As ConnectorBase In tonode.Edges 
                    Dim node As Node = TryCast(con.ToNode, Node) 
                    If tonode.Equals(node) Then 
                        Continue For 
                    End If 
                    text += node.Name + Constants.vbLf + con.Name 
                Next con 
                MessageBox.Show(text) 
            End If 
        End Sub 
  
Sample:  
  
Sample  
  
Video: 
 
  
Regards,  
  
Naganathan K G  
 


Loader.
Up arrow icon