I try to synchronize the scroll into the gantView (the scroll into the panel which show event) with an other scrollViewer outside the ganttView.
the WrapPanel into scroll Viewer have the same size that event panel in the gantt, ant this panel contains month with same size thant month in the gantView (same number of month in my panel and month in the visible range in the gantt view, month represent by a rectangle and other thing ). The goal is to move scroll in one according to the other, to have the same months showing in the gantView and my panel.
fo this, I thinking suscribe to the event ScrollChanged in the two controls and work with HorizontalOffset in order to synchronize the two scroll, but I don't find this event in the ganttView.
Do you think what I try it's possible ?
5 Answers, 1 is accepted
Internally the RadGanttView contains 3 ScrollBars - 2 horizontal ( for the GridView part and for the TimeRuler part ) and 1 vertical.
We can get these ScrollBars using the RadGanttView.ChildrenOfType<ScrollBar>() method. We can then use the Value if the TimeRuler area horizontal ScrollBar to scroll some other ScrollViewer with a horizontal offset equal to this Value.
I've attached a sample project demonstrating this approach. I handle the RadGanttView.SelectionChanged event and in it I scroll a ScrollViewer containing a ListBox with the same offset as the TimeRuler horizontal ScrollBar.
Hopefully this helps.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
How can I detect the TimeRuler horizontal ScrollBar scroll event? RadGanttView.SelectionChanged event works fine if I select a Task on the Gantt but if I scroll the bar nothing happens.
As mentioned in the previous post - "internally the RadGanttView contains 3 ScrollBars - 2 horizontal ( for the GridView part and for the TimeRuler part ) and 1 vertical." The second ScrollBar is the TimeLine area horizontal scroll bar.
One approach is to get this scroll bar when the RadGanttView loads and then add handler to its Scroll event:
Hope this helps.
Telerik by Progress
Thanks! Your suggestion helped me accomplish what i wanted!