Connecting between two nodes

I am using the Essential Studio 5.1.1.0 Diagram, and i was trying to connect two node together using a line.

The exception throw is SystemArgumentException occured in Syncfution.Diagram.Base.dll

I had been working around for hours but no solution. Hope you could help me to look it to it. The C# project file is attached here as well.

Thank you.

Carso.

WindowsApplication413.zip

2 Replies

MF Meera Fathima Syncfusion Team June 25, 2007 11:47 AM UTC


Hello Carso,

Thank you for using Essential Diagram.

It seems the both the head endpoint and tail endpoint of the line connector have the same value and hence the application raises exception. To overcome this issue you need to set the nodes( which are connected using the connector) pinpoint value.

I have added the pinpoint value for circle and polygon node. Below is the modified code snippet for your reference.

// Circle
Syncfusion.Windows.Forms.Diagram.Ellipse circle = new Syncfusion.Windows.Forms.Diagram.Ellipse(0, 0, 96, 72);
circle.PinPoint = new PointF(50, 50); // Set the Pinpoint value.
circle.Name = "Circle";
circle.FillStyle.Type = FillStyleType.LinearGradient;
circle.FillStyle.ForeColor = Color.AliceBlue;
circle.ShadowStyle.Visible = true;
model1.AppendChild(circle);

// Polygon
PointF[] pts ={ new Point(6, 36), new Point(48, 6), new Point(90, 36), new Point(48, 66) };
Polygon polygon = new Polygon(pts);
polygon.PinPoint = new PointF(100, 200); // Set the Pinpoint value.
polygon.Name = "Polygon";
polygon.FillStyle.ForeColor = Color.DarkSeaGreen;
polygon.FillStyle.Color = Color.DarkSeaGreen;
model1.AppendChild(polygon);

// Connector
LineConnector line = new LineConnector(circle.PinPoint, polygon.PinPoint);
model1.AppendChild(line);

polygon.CentralPort.Connect(line.HeadEndPoint);
circle.CentralPort.Connect(line.TailEndPoint);

I hope the above details are helpful to you. Please let me know if you have any more questions.

Thanks,
Meera.


CA Carso June 26, 2007 03:53 AM UTC


Thank you, now i can connect the nodes.

Loader.
Up arrow icon