I have many Collapsible Panels in my Scrollable Panel, what I need it to do, is if the user expands a panel, I need that panel to scroll to the top of the scrollable panel. Is there a way to pragmatically do this?
TIA.
1 Answer, 1 is accepted
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 05 Jun 2023, 09:55 AM
Hello,
Following the provided information, I have prepared a sample project to get better understanding of the precise case. The RadScrollablePanel.VerticalScrollbar.Maximum property gives you information about the current range for the vertical scrollbar according to the size of the panel.
If the RadScrollablePanel.AllowAutomaticScrollToControl property is enabled, this means that the view will be scrolled to the currently active control. Hence, in order to scroll to a specific control, you just need to focus it:
Note that this is just a sample approach and it may not cover all possible cases. Feel free to further extend it and modify it in a way which suits your requirements best.
Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik
Thanks, we have the property set. We are also setting focus to that control as well, but we had cases, where some of our Collapsible Panels would not be completely show and the user would have to scroll down still. What we did was implemented a hidden control, at the bottom of the last Collapsible Panel, and every time one of our panels are Expanded and/or focused, we set focus to that control first, then we set focus back to the original panel. This achieves the following. 1. Shows the entire panel in the scrollable panel and 2, for all the panels except the last few, the panel is always at the top of the scrollable panel (which is the desired affect). We do have issues with the last few panels not pushing to the top of the scrollable panel (but they show the entire panel), but I think we understand way.
Thanks for the help on this.
Dess | Tech Support Engineer, Principal
Telerik team
commented on 06 Jun 2023, 01:15 PM
Hi, Mark,
It sounds like you succeeded to observe the required custom behavior. Focusing the hidden control just below the collapsible panel is a valid approach and you can use it for your needs. Should you have further questions please let me know.