Preset ports

How to have preset ports for a node to be dragged and dropped from PGBar? For instance, if I have a rectangle node from the PGBar with one entering port and two leaving ports which are already defined. As such, when the node is dropped on the diagram sheet, one can use the entering port to connect to this node, and the two exit ports for the leaving connectors.  The exit ports should prevent incoming connection. And entry port should prevent outgoing connection from the node

1 Reply

NG Naganathan Ganesh Babu Syncfusion Team March 29, 2018 07:08 AM UTC

Hi Allen, 
 
We suggest you to use ConnectionPoint’s “ConnectionPointType” property to set the type to accept incoming/outgoing connection alone while initializing the port. Please refer to the below code example and our online documentation link. 
 
Code example: 
 
[VB] 
 
Dim rect As New Syncfusion.Windows.Forms.Diagram.Rectangle(100, 100, 100, 100) 
 
Dim cp1 As New ConnectionPoint() 
cp1.ConnectionPointType = ConnectionPointType.Incoming 
cp1.Position = Position.TopCenter 
rect.Ports.Add(cp1) 
 
Dim cp2 As New ConnectionPoint() 
cp2.ConnectionPointType = ConnectionPointType.Outgoing 
cp2.Position = Position.BottomLeft 
rect.Ports.Add(cp2) 
 
Dim cp3 As New ConnectionPoint() 
cp3.ConnectionPointType = ConnectionPointType.Outgoing 
cp3.Position = Position.BottomRight 
rect.Ports.Add(cp3) 
 
diagram1.Model.AppendChild(rect) 
 
Online documentation link: 
 
 
Regards, 
 
Naganathan K G 


Loader.
Up arrow icon