This is a migrated thread and some comments may be shown as answers.

Preserving Expanded/Collapsed

2 Answers 96 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 18 Jul 2011, 09:00 PM
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 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 19 Jul 2011, 08:05 AM
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!

0
Bob
Top achievements
Rank 1
answered on 19 Jul 2011, 12:46 PM
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
Tags
TreeListView
Asked by
Bob
Top achievements
Rank 1
Answers by
Milan
Telerik team
Bob
Top achievements
Rank 1
Share this question
or