I have a TreeView and when I have a large list of items, the control on the scroll bar will automatically shrink itself to adjust for the scroll bar. Is there a way to have the control of the scroll bar stay in the same size or resize itself at the beginning when the list is loaded? I have attached a picture for this. As shown in the picture, 1 is the size of the control at the beginning and 2 is the size of the control when scroll down.
Thanks
5 Answers, 1 is accepted
Most probably you are loading the TreeView in expanded mode (i.e. some of the items outside the view port are expanded). This could be the reason for changing the scroll thumb size while scrolling.
If this is the case you could collapse these items and let the user expand them explicitly. If you would like to preserve some user state you could use the BringPathIntoView method to show the required node.
Unfortunately there is no out of the box way to manipulate the thumb size and stop it from shrinking.
If the suggested approach does not fit your needs, could you please share a bit more info about you application and what are you trying to do?
Hristo
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Thanks for you suggestions. The TreeView is in expanded mode and I want to leave it as expanded mode. Is there a way to have the scroll thumb in the correct size at beginning instead of shrinking as I scroll down to account for other expanded nodes?
Thanks!
You should force the TreeView to realize all the containers in the whole hierarchy and disable the Virtualization (IsVirtualizing=false).
By doing this the scroll viewer will know the exact TreeView size and will adjust the scroll size. Our TreeView is creating its visual items as lazy as possible in order to increase the performance. Thus realizing all the items will decrease the performance.
The way to realize all the containers is to ensure every one of them has been visible at some point in the view port. Two approaches could be employed here.
1) Make the TreeView large enough to show the whole hierarchy. Then restore the TreeView size to required by the application value.
2) The more cumbersome approach is to scroll the TreeView showing the next unrealized item. This should be done as many time as needed in order to scroll through all items.
Hope this helps.
Hristo
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
This resolved my issue.