Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Status: New
XamOrgChart WPF : Method that centers a (selected)Node into the viewport (without zooming)

My Question

we are using your OrgChart for WPF..
Is it possible to center a (selected)Node into the viewport programmatically  ?

Answer from employee Infragistics :

I have been investigating into your requirement in this case and this is doable, although it would not be simple as there is no method on the XamOrgChart that would do this for you.

The XamOrgChart has a WorldRect property that returns a Rect object that represents the full height and width of the entire XamOrgChart if it fit into a rectangular area. The XamOrgChart also has a WindowRect property that returns the X and Y position of the zoom of the WorldRect and the percentage of the WorldRect that is currently in view.

In order to bring a particular node into the center of the XamOrgChart, at the moment you would need to modify this WindowRect with respect to the X and Y position of the top-left of the visible area. In order to do this, you would also need to calculate the position of the particular OrgChartNode relative to the WorldRect, and it does not appear that there is anything exposed to allow this.

As such, if you would like to see the ability to bring an OrgChartNode into the center of the viewport of the XamOrgChart, I would recommend suggesting a new product idea for a method or something of the like to be developed to do this. You can suggest this idea at after signing into your account on the Infragistics website. This will place you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community and user feedback.