RowDetails state not preserve when navigate with DataContext inherited

2 posts, 0 answers
  1. Luc
    Luc avatar
    11 posts
    Member since:
    Feb 2013

    Posted 19 Aug 2015 Link to this post


     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 ?



  2. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 21 Aug 2015 Link to this post

    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?

    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
  3. DevCraft R3 2016 release webinar banner
Back to Top