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

RowDetails state not preserve when navigate with DataContext inherited

1 Answer 92 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Luc
Top achievements
Rank 1
Luc asked on 19 Aug 2015, 03:42 PM

Hi,

 I posted a sample project here to illustrate issue.

 I use a prism project to navigate between view (I don't think that issue is related to prism and think can be reproduce with tabcontrol for sample). I have one page with one RadGridView and one fake page. In the attached project if you navigate to the gridview page, expand some row and return to the fake page so when you go back to the grid all rows are collapsed and expanded state was not preserved.

After investigation it's appear that if I set the DataContext of ViewGrid control in its constructor all works like desire, rows expanded are preserve. For sample replacing ctor "public ViewGrid()  {  InitializeComponent(); }" by "public ViewGrid(Model m) { InitializeComponent(); this.DataContext = m; }" works fine.

Unfortunatly I can not do that and viewmodel is created in the MainWindow.

How can I preserve the rowdetail state ?

 Thanks

Luc
       

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 21 Aug 2015, 10:35 AM
Hello Luc,

Looking at the test project, I did not locate a TabControl, but a ListBox. Generally, if the RadGridView's ItemsSource is reset, this will result in reloading the entire view which leads to collapsing the row details.

Would you please try using RadTabControl setting its IsContentPreserved property to True so that the content in the TabItems to be initialized only once?

Regards,
Dimitrina
Telerik
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
Tags
GridView
Asked by
Luc
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or