Preserving Expanded/Collapsed

3 posts, 0 answers
  1. Bob
    Bob avatar
    9 posts
    Member since:
    Nov 2010

    Posted 18 Jul 2011 Link to this post

    Hi,

    I have an app with a TabControl. Each item in the TabControl has a RadTreeListView. When I switch between the tabs, the hierarchy in the RadTreeListView gets collapsed. The problem, of course, is that the IsExpanded states is preserved only in the RadTreeListView and TabControl virtualizes its contents, i.e. if there are three tabs, it only creates one RadTreeListView and when the user selects a tab, then only thing that changes is the RadTreeListView's DataContext.

    The solution would be to bind each row's IsExpanded property to a property in my ViewModel. But from my reading of other posts in this forum, it appears that binding to a TreeListViewRow's IsExpanded property doesn't work.

    How can I preserve the IsExpanded state when I switch between tabs?

    Thanks,
        Bob Alexander
  2. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 19 Jul 2011 Link to this post

    Hi Bob,

      You can also try setting the IsContentPreserved property of the tab control to true which will preserve the state of tabs that are not opened. 

    Kind regards,
    Milan
    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. UI for WPF is Visual Studio 2017 Ready
  4. Bob
    Bob avatar
    9 posts
    Member since:
    Nov 2010

    Posted 19 Jul 2011 Link to this post

    Hi Milan,

    I'm using the WPF TabControl, not the Telerik one. So I really need a ViewModel-based solution. What are my other option(s)?

    Thanks,
       Bob
Back to Top