Autofit doesn't zoom to extents

3 posts, 1 answers
  1. Douglas
    Douglas  avatar
    10 posts
    Member since:
    Sep 2011

    Posted 19 Nov 2012 Link to this post

    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. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 21 Nov 2012 Link to this post

    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.

  3. DevCraft banner
  4. Douglas
    Douglas  avatar
    10 posts
    Member since:
    Sep 2011

    Posted 21 Nov 2012 Link to this post

    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
Back to Top