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. Image for the cookie policy date
close icon

hide the page border on a diagram?

Is there a way to hide the page border in my diagram? I'm trying to give the illusion of infinite space but can't get rid of the page border (see screen in attachment).

I've tried the following:

this.diagram1.View.PageBorderStyle.BorderColor = Color.Transparent;
this.diagram1.View.PageBorderStyle.ShowBorder = false;
this.diagram1.View.PageBorderStyle.BorderWeight = BorderWeight.Thick;

But that seemed to have no effect.

Thanks for the help,
John



syncfusionExample_7f069fae.zip

7 Replies

AA Amsath Ali M Syncfusion Team September 13, 2011 10:24 AM UTC

Hi Johnathan,

Thanks for your interest in Syncfusion products.

We suggest you to set the Diagram.Model.LineStyle’s ‘LineWidth’ to ‘0’ to achieve your requirement.

Here is the code:
[C#]
this.diagram1.Model.LineStyle.LineWidth = 0;

For your convenience we have created a simple sample to achieve your requirement.
Please try the below sample and let us know if you have any queries.
CS1613104894.zip

Regards,
Amsath Ali. M




JT Johnathan Tunnicliffe September 14, 2011 01:59 PM UTC

Thanks very much, that works great.

I have one more question (slightly unrelated to this one):
What's the way to get the bounds of the current view in the document? Idea would be to ensure that anytime a new node was added, it gets created in center of the page wherever the user happens to be looking in the document.

Thanks very much



AA Amsath Ali M Syncfusion Team September 15, 2011 03:27 PM UTC

Hi Johnathan,

Thanks for the update.

We suggest you to use the Diagram.Model’s ‘DocumentSize’ property to get the current document size of the diagram.

Here is the code:
[C#]
PageSize ModelSz = diagram1.Model.DocumentSize;
Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(ModelSz.Width/2,ModelSz.Height/2,50,50);
rect.PinPoint = new PointF(ModelSz.Width / 2, ModelSz.Height / 2);
this.diagram1.Model.AppendChild(rect);

For your convenience we have created a simple sample to achieve your requirement.
Please try the below sample and let us know if you have any queries.
Forum Adding node in center949917353.zip

Regards,
Amsath Ali. M




JT Johnathan Tunnicliffe September 16, 2011 08:48 AM UTC

What I was asking for is if I was zoomed into a section of the document (imagine a giant document), I want to calculate the middle of the view i'm currently looking.

So if i have a giant document and I can only see the bottom right corner of the document and I add a node, I want it to be added in the center of the screen I'm looking at.



AA Amsath Ali M Syncfusion Team September 22, 2011 04:43 AM UTC

Hi Johnathan,

Thanks for the update.

We suggest you to convert Diagram.view’s ‘Clientsize’ to model co-ordinates to achieve your requirement.

Here is the code snippet:
System.Drawing.Rectangle rg = diagram1.Controller.ConvertToModelCoordinates(diagram1.View.ClientRectangle);
Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(rg.Width / 2, rg.Height / 2, 50, 50);
rect.PinPoint = new PointF(rg.Width / 2, rg.Height / 2);
this.diagram1.Model.AppendChild(rect);

Please try the below sample and let us know if you have any queries.
Forum Adding node in center2003573880.zip

Regards,
Amsath Ali. M




JT Johnathan Tunnicliffe September 26, 2011 05:29 PM UTC

Thank you, that works great



AA Amsath Ali M Syncfusion Team September 27, 2011 05:01 AM UTC

Hi Johnathan,

Thanks for the update.

We are happy to hear that the issue has been resolved.
Please let us know if you require further assistance.

Regards,
Amsath Ali. M


Loader.
Live Chat Icon For mobile
Up arrow icon