Bummer - tree view scrolls back to the top

2 posts, 0 answers
  1. David
    David avatar
    2 posts
    Member since:
    Aug 2008

    Posted 07 Nov 2008 Link to this post

    I have a scenario that's driving me nuts and I'm trying to figure out if the problem I'm having is a bug in the treeview control or if there's a workaround I can use:

    I have a treeview in a split container.  Whenever the splitter is moved, the treeview scrolls back to the top.

    The scenario is this: I have a treeview in the top of the splitter and a panel in the bottom of the splitter.  When the user hovers over a node in the treeview, I fill in information about the node in the panel at the bottom.  It's kinda like a super tooltip.  The key issue is that I want the panel at the bottom to only take as much space as needed, so I move the splitter programmatically so there is no wasted space in the bottom of the splitter and the maximum amount of the tree view is visible. So, when the splitter gets moved (in this case, programmatically) to treeview scroll position resets to the top.

  2. Jordan
    Jordan avatar
    547 posts

    Posted 10 Nov 2008 Link to this post

    Hello David,

    Indeed, at the moment when the RadTreeView control is resized its scroll position is reset to 0, which is not very intuitive. This behavior will be corrected for our next release.

    For now you can use the following workaround: save the old scroll position, change the splitter position, then restore the scroll position:

                int scrollBarValue = this.radTreeView1.VScrollBar.Value; 
                this.splitContainer1.SplitterDistance = 500; 
                this.radTreeView1.VScrollBar.Value = scrollBarValue; 

    Sorry for the introduced inconvenience.

    Kind regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top