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.
Unfortunately, activation email could not send to your email. Please try again.

hide the page border on a diagram?

Thread ID:

Created:

Updated:

Platform:

Replies:

100881 Sep 12,2011 08:59 AM Sep 27,2011 01:01 AM Windows Forms 7
loading
Tags: Diagram
Johnathan Tunnicliffe
Asked On September 12, 2011 08:59 AM

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

Amsath Ali M [Syncfusion]
Replied On September 13, 2011 06:24 AM

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



Johnathan Tunnicliffe
Replied On September 14, 2011 09:59 AM

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


Amsath Ali M [Syncfusion]
Replied On September 15, 2011 11:27 AM

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



Johnathan Tunnicliffe
Replied On September 16, 2011 04:48 AM

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.


Amsath Ali M [Syncfusion]
Replied On September 22, 2011 12:43 AM

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



Johnathan Tunnicliffe
Replied On September 26, 2011 01:29 PM

Thank you, that works great


Amsath Ali M [Syncfusion]
Replied On September 27, 2011 01:01 AM

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


CONFIRMATION

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.

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.

;