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. Image for the cookie policy date

Getting Vertical Offset in the SfDiagram ScrollViewer

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!

1 Reply

RT Ramya Thirugnanam Syncfusion Team March 21, 2019 05:54 AM UTC

Hi Michael, 
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. 
We have provided sample for your requirement. Please find the sample through the below link. 
Ramya T 

Live Chat Icon For mobile
Up arrow icon