I am looking for a way to get the Vertical Offset from the SfDiagram ScrollViewer. I have an application that as it runs, the nodes will be created in a vertical fashion and I want the diagram to scroll to that node as it gets created, but I am not finding any properties that contain where the current offset is stored. Any help would be appreciated!
RTRamya Thirugnanam Syncfusion Team March 21, 2019 12:54 AM
Thanks for contacting Syncfusion support.
We have analyzed your requirement and provided suggestions for it.
Suggestion 1 - Verticaloffset through ScrollSetting Property :
We can get the VerticalOffset value through the ScrollSettings property of the SfDiagram. We have provided code example for this.
Code Example :
//Getting VerticalOffset through ScrollSettings Property of SfDiagram
var verticaloffset = Diagram.ScrollSettings.ScrollInfo.VerticalOffset;
//Where Diagram is the instance of SfDiagram
Suggestion 2 – BringIntoCenter and BringIntoView method:
We can bring the newly added node to the center of the view or within the view by using BringIntoCenter and BringIntoView method. We have provided kb document for this. Please refer to the kb from the following link.