This is a migrated thread and some comments may be shown as answers.

Scrollbar auto shrinking

5 Answers 126 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Qu
Top achievements
Rank 1
Qu asked on 10 Aug 2012, 12:31 AM
Hi All,

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

Sort by
0
Qu
Top achievements
Rank 1
answered on 13 Aug 2012, 07:01 AM
Any help please?
0
Hristo
Telerik team
answered on 14 Aug 2012, 07:18 AM
Hi Qu Luu,

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?

All the best,
Hristo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Qu
Top achievements
Rank 1
answered on 15 Aug 2012, 08:50 PM
Hi Hristo,

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!
0
Accepted
Hristo
Telerik team
answered on 17 Aug 2012, 02:01 PM
Hi,

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.

All the best,
Hristo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Qu
Top achievements
Rank 1
answered on 23 Aug 2012, 06:37 PM
Thank you very much!
This resolved my issue.
Tags
TreeView
Asked by
Qu
Top achievements
Rank 1
Answers by
Qu
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or