In the recent project, I want to control the scrollViewer on the diagram and set the offset of the scrollViewer. I looked at the API and found that the offset property is not public. What should I do?
Any help would be appreciated.
3 Answers, 1 is accepted
answered on 18 Jan 2019, 12:09 PM
I am not sure how you have added the ScrollViewer to the RadDiagram control but the ScrollViewer itself has a ScrollToHorizontalOffset() and ScrollToVerticalOffset() methods which you can use to change the offset. May I ask you to elaborate more on your application set up so I could better understand your scenario.
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.
but,RadDiagram can't find Scrollviewer by this way.
answered on 23 Jan 2019, 02:21 PM
Thank you for elaborating your approach.
When the ScrollViewer.HorizontalScrollBarVisibility and ScrollViewer.VerticalScrollBarVisibility are set to Visible ScrollBar will be added to the RadDiagram, not ScrollViewer. That is why the ChildrenOfType<T>() will return null. The ScrollBar provide Value property which can be set to change the position of the thumb. For example, you can subscribe to the loaded event of the RadDiagram and using the mentioned extension method you can get the horizontal and vertical scrollbars. The following code snippet gets the vertical scrollbar and set the value of 50 where the Maximum property is 100 on my side.