BringPathIntoView Not Working With ExpandAll

3 posts, 0 answers
  1. Scott Michetti
    Scott Michetti avatar
    111 posts
    Member since:
    Feb 2010

    Posted 01 Oct 2015 Link to this post


    after I load the tree I want to expand all items, then call BringPathIntoView(). This does not work. If I do not call ExpandAll(), BringPathIntoView will select the correct item. My requirement is that I expand the whole tree and select a specific item based on certain rules. Here's my code:

     radTreeView.ItemsSource = _radTreeViewItems;




    The "something\\somethingChild" path is an item near the bottom of a large tree and it does not scroll down. Is there a way to wait for the ExpandAll() method to finish, then call BringPathIntoView?




  2. Dinko
    Dinko avatar
    1037 posts

    Posted 02 Oct 2015 Link to this post

    Hello Scott,

    In order to achieve the desire effect you can call ExpandAll() method in the constructor in the MainPage constructor then you can call BringPathIntoView() method in the event handler of the  TreeView Loaded event.
    public MainPage()
        myTreeView.Loaded += myTreeView_Loaded;
    private void myTreeView_Loaded(object sender, RoutedEventArgs e)
        // example path
        string path = "0\\0.3\\0.3.0\\";
        Dispatcher.BeginInvoke(new Action(() =>
        }), DispatcherPriority.Background);
    To make this work properly you will need to call the BringPathIntoView() method into a Dispatcher with its DispatcherPriority set to Background.

    If this solution is not the answer you are looking for don't hesitate to contact us.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Scott Michetti
    Scott Michetti avatar
    111 posts
    Member since:
    Feb 2010

    Posted 06 Oct 2015 in reply to Dinko Link to this post

    Thanks Dinko,

    that helped.

Back to Top