This is a migrated thread and some comments may be shown as answers.

Autofit doesn't zoom to extents

2 Answers 30 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Douglas
Top achievements
Rank 1
Douglas asked on 19 Nov 2012, 01:36 PM
Hi,

I've created a diagram bound to items in a database. These number in the region of 400 and are represented as simple rectangles with connections (arrows) to other rectangles based on there relationship these objects. 

The diagram works well apart from the zoom to extents does not zoom to the entirety of the diagram. Similarly if I attach a button which programattically zooms the diagram out, the zoom only zooms out to a certain level before refusing to zoom out any further. The same behaviour is observed if I include a navigation pane.

Is there a way around this so I can zoom to extents or is this a known bug.

Thanks
Doug

2 Answers, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 21 Nov 2012, 12:37 PM
Hi Douglas, 

We are not very sure what is your actual issue, maybe any snapshots / pictures will help us better understand it. However, we strongly recommend you to try out two features of the Diagram:
  • Use FitTo() method instead of Autofit(). FitTo() zooms and Pans the diagram to a given Rect given as parameter to the function. You can give the Diagram.ViewPort for instance.
  • Try  Extending the default Zoom constants. This can be achieved by setting:
DiagramConstants.MinZoom = 0.01;
DiagramConstants.MaxZoom = 10;
in InitializedComponent (before loading of the Diagram).

We hope these tricks can help in your scenario. Let us know how it goes.

All the best,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Douglas
Top achievements
Rank 1
answered on 21 Nov 2012, 02:50 PM
Hi,

Thanks for your assistance - this is exactly what I needed! I didn't see anything in the docs about these Diagram constants in the zoom section...so could be good to add this there.

Cheers
Doug
Tags
Diagram
Asked by
Douglas
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Douglas
Top achievements
Rank 1
Share this question
or