Scrollbar auto shrinking

6 posts, 1 answers
  1. Qu
    Qu avatar
    4 posts
    Member since:
    Aug 2012

    Posted 09 Aug 2012 Link to this post

    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
  2. Qu
    Qu avatar
    4 posts
    Member since:
    Aug 2012

    Posted 13 Aug 2012 Link to this post

    Any help please?
  3. DevCraft banner
  4. Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 14 Aug 2012 Link to this post

    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.

  5. Qu
    Qu avatar
    4 posts
    Member since:
    Aug 2012

    Posted 15 Aug 2012 Link to this post

    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!
  6. Answer
    Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 17 Aug 2012 Link to this post

    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.

  7. Qu
    Qu avatar
    4 posts
    Member since:
    Aug 2012

    Posted 23 Aug 2012 Link to this post

    Thank you very much!
    This resolved my issue.
Back to Top
DevCraft banner