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.

Zoom to fit in diagram view

Thread ID:

Created:

Updated:

Platform:

Replies:

79240 Jan 26,2009 03:16 PM Feb 5,2009 04:56 AM Windows Forms 4
loading
Tags: Diagram
Lotfi Belattar
Asked On January 26, 2009 03:16 PM

Hello,

I'm trying to add a Zoom to fit feature to my diagram control view.

I tried this:
diagram.View.FitDocument();
It did not work.
Is there an easy way to do it ?

Regards,
Lotfi



Ajeet M [Syncfusion]
Replied On January 27, 2009 02:40 AM

Hi Lofti,

You can use the following code snippet:

this.diagram1.FitDocument();

Let me know if this helps.

Happy Coding!
- Ajeet



Lotfi Belattar
Replied On January 27, 2009 05:36 PM

Thank's Ajeet! That works!


Lotfi Belattar
Replied On February 4, 2009 06:07 PM

Hello Ajeet,

I need to remove the size to content (this.diagram1.Model.SizeToContent = false) in my application in order to create a diagram without bounding for my nodes.
By doing this, the FitDocument (this.diagram1.FitDocument() )is not working properly.
Is there another way to fit my nodes in my view ?

Thanks
Lotfi



Ajeet M [Syncfusion]
Replied On February 5, 2009 04:56 AM

Hi Lotfi,

The FitToDocument() is used to fit the entire diagram to your view area.

The SizeToContent = true keeps the bounds flexible, ensuring that all the nodes on the model are accommodated easily.

When the SizeToContent = false, is set, it becomes our responsibility to ensure that all the nodes are inside the bounds of the model.

Thus, I would suggest you to manually set the model's logical size to a size you feel, will accommodate all the nodes perfectly.

Let me know if you shall need any further clarifications in this regard.

Happy Coding!
- Ajeet



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.

;