The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I am just trying to create a symbol and add it to a diagram and I get an overflow error. Isn''t there any simple examples of say adding two nodes and making one the root and one a child to a diagram programatically.
I have try both the InsertNodesCmd and AppendChild.
ADAdministrator Syncfusion Team May 27, 2004 06:29 PM UTC
Hi Chuck
a) Which version of Essential Diagram are you currently using?
b) Have you taken a look at the DynamicSymbol sample that ships with Essential Diagram. In this sample refer to the MySymbol.cs file which demonstrates how you can create a custom symbol and programmatically add child nodes to it.
Kindly post an update if you have any further questions.
Regards
Arun
ADAdministrator Syncfusion Team June 7, 2004 06:52 PM UTC
Hi,
We very recently fixed a problem that was causing an overflow exception when trying to add symbols containing zero width/height shapes(horizontal/vertical line nodes). It''s possible that your problem is being caused by this error in the diagram code. If so, then the next update of Essential Diagram should take care of this issue for you.
Regards,
Prakash
Syncfusion, Inc
JBJames BrockNovember 29, 2004 09:07 AM UTC
Hi Arun,
I am using version 2.1.0.30 with VS.2003 and am attempting a rather basic task. I am creating a form which contains a Diagram component. In my Form_OnLoad event I "load a symbol" using the following code:
private void LoadTheSymbol()
{
try
{
// create a symbol
Symbol defSymbol = new Symbol();
defSymbol.Height = 100;
defSymbol.Width = 100;
defSymbol.X = 10;
defSymbol.Y = 10;
defSymbol.LineStyle.LineWidth = 1.1F;
defSymbol.FillStyle.Color = Color.Red;
// add a port
AnchoredPort port = new AnchoredPort(defSymbol, BoxPosition.TopLeft);
port.Load(PortVisuals.CirclePort);
port.Visible = true;
// add a label
SymbolLabel lbl = new SymbolLabel();
lbl.Anchor = BoxPosition.BottomRight;
lbl.Text = "Child";
defSymbol.Ports.Add(port);
defSymbol.Labels.Add(lbl);
// add child to model
diagramSymbol.Model.AppendChild(defSymbol, diagramSymbol.Model.DefaultLayerName);
diagramSymbol.View.Update();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
When I call diagramSymbol.View.Update() I get an overflow error.
I have tried the following all to no avail:
1) Not calling View.Update(), instead the overflow error occurs in my form.ShowDialog() method.
2) Using InsertNodesCmd, overflow occurs when calling Controller.ExecuteCommand(myCmd)
3) Calling Diagram.Refresh(), again this then delays the "overflow" until later on.
Am I doing something daft? Any thoughts appreciated.
Thanks
Jimski
ADAdministrator Syncfusion Team November 29, 2004 06:53 PM UTC
Hi Jimski
I could not reproduce the problem using the 3.0 release candidate. Here is a sample where I pasted your code in the Form_Load and had no problems.
Regards
Arun