We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Diagram + WebPart problem

Thread ID:





71967 Feb 23,2008 12:01 AM UTC Mar 11,2008 08:45 AM UTC ASP.NET Web Forms (Classic) 1
Tags: DiagramWebControl
Asked On February 23, 2008 12:01 AM UTC


Syncfusion looks very nice for us but we have a little problem with the diagram control.

We want to create the diagram in a webpart so we don't have a designer. I have found in the documentation an example on how to create diagram through the code but it is not compiling due to many errors because the example is for Windows not ASP.NET and especialy not for Web Part.

The code I used:
System.Web.UI.WebControls.Button btn = new System.Web.UI.WebControls.Button();
btn.Text = "asd";
//Syncfusion.Web.UI.WebControls.Tools.TreeView tv = new Syncfusion.Web.UI.WebControls.Tools.TreeView();
Syncfusion.Web.UI.WebControls.Diagram.DiagramWebControl diag = new Syncfusion.Web.UI.WebControls.Diagram.DiagramWebControl();
Syncfusion.Windows.Forms.Diagram.Model model1 = new Syncfusion.Windows.Forms.Diagram.Model();
diag.Model = model1;
model1.Size = new SizeF(700, 700);
diag.height = 700;
diag.width = 700;
diag.BackColor = System.Drawing.Color.Aqua;

diag.EnableNodeSelection = true;
diag.EnableDragDrop = false;

Syncfusion.Windows.Forms.Diagram.Rectangle r = new Syncfusion.Windows.Forms.Diagram.Rectangle(1, 1, 100, 100);
MeasureUnits units = MeasureUnits.Pixel;
((IUnitIndependent)r).SetPinPoint(new PointF(5,5), units);
r.EnableCentralPort = true;

The problem is that the diagram is shown (even with its background color) but the rectangle is not shown.. What could be wrong?

Thanks in advance!

Administrator [Syncfusion]
Replied On March 11, 2008 08:45 AM UTC

Hi Blaze,

Thank you for your interest in Syncfusion Products.

It is possible to create a Diagram Web Control at run time and add nodes to it. Please find the code snippet that illustrates this:

DiagramWebControl diag = new DiagramWebControl();
diag.Height = 700;
diag.Width = 700;
diag.BackColor = System.Drawing.Color.AliceBlue;
diag.EnableNodeSelection = true;
diag.EnableDragDrop = false;
Syncfusion.Windows.Forms.Diagram.Rectangle r = new Syncfusion.Windows.Forms.Diagram.Rectangle(10, 10, 100, 100);
r.FillStyle.Color = Color.Blue;
r.EnableCentralPort = true;

Please find the simple sample in the following link:


Please let me know if any concerns.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon