Treeview MVVM IsSelected not working...

2 posts, 0 answers
  1. Tolga
    Tolga avatar
    8 posts
    Member since:
    Mar 2011

    Posted 03 Jul 2011 Link to this post


    I am using a RadTreeView inside a MVVM Silverlight project. I am setting the IsSelected property in my viewmodel, but the TreeView does not automatically display (or brings to front) the selected item. If I expand the parent folder then it shows the item selected. How can I make this work?

  2. Petar Mladenov
    Petar Mladenov avatar
    2882 posts

    Posted 06 Jul 2011 Link to this post

    Hi Tolga,

    This is expected behavior of the RadTreeView. In order to "bring this item into view", you can bind the IsExpanded property of the RadTreeViewItems via ContainerBindings and set the corresponding boolean property in the ViewModel to true for all parent items of the selected one.
    Another solution uses the BringItemIntoView series of methods. For further info on this, you can check out this help article.

    Best wishes,
    Petar Mladenov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
Back to Top