ensure visible and select node

6 posts, 0 answers
  1. liat even
    liat even avatar
    2 posts
    Member since:
    Nov 2009

    Posted 16 Nov 2009 Link to this post

    Hello,

    I am building a tree programmatically. After adding all of the items i would like to select one of them and to scroll to it (ensure that it is visible). i am using the node object (RadTreeViewItem) to set the IsSelected property to true, and then use the EnsureVisible method. The node is indeed selected. However any methods that are registered to the Selected event are not invoked. In addition, the item stays invisible and manual scrolling is required. 

    Any ideas?

    thanks,
    Liat.
  2. Ivan
    Admin
    Ivan avatar
    519 posts

    Posted 18 Nov 2009 Link to this post

    Hi Liat,

    About selecting and showing the item please preview the Expanding a Databound TreeView initially article. There is a working example too.

    About the selected event please note if the container is not constructed then the Selected event is not raised. Instead you can rely on the SelectionChanged event of the TreeView control.

    Sincerely yours,
    Ivan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WPF is Visual Studio 2017 Ready
  4. GiWorking
    GiWorking avatar
    3 posts
    Member since:
    Dec 2011

    Posted 22 Aug 2012 Link to this post

    The solution is missing, the link does not function.
    I would appreciate to see it.
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 22 Aug 2012 Link to this post

    Hello Jean-Marc,

    This is an old thread and the link and the approach it described, don't work anymore. Instead, you can have a look at this blog post describing the RadTreeView.BringPathIntoView method. If you need to bring virtualized items into view, this method is your best choice. As the solution attached in the blog is targeting Silverlight, I've attached its WPF version here.

    All the best,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. GiWorking
    GiWorking avatar
    3 posts
    Member since:
    Dec 2011

    Posted 22 Aug 2012 Link to this post

    Hello Tina,
    Do you have a wpf version of this example that you from this blog :
    http://blogs.telerik.com/xamlteam/posts/11-01-12/treeview-bringintoview.aspx
    I do not have silverlight.
    thanks

    Jean-Marc

    I wish to thank you for the code you sent me, I found a solution to that works fine with the IEventAggregator.

    Thanks,
  7. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 23 Aug 2012 Link to this post

    Hello Jean-Marc,

    I'm glad the solution helps. Let me know if I can further assist you.

    All the best,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready