Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
390
Grid losing it's sort
posted

I'm using MVVM, and have a XamTabControl which contains a user control that contains a grid.  When I group or sort that grid, click on another tab and click back I lose my groupings and sorts.  

I've included a test project which has two window forms.

Window1 - Contains a xamTabControl 2 tabs defined in xaml, each contains a UserControl1

Window2 - Contains a xamTabControl which has it's ItemsSource property bound to a collection.  This window uses a ResourceDictionary to determine which view to use to display the data.

 

Window1 works as I would expect.  If you sort one grid it doesn't effect the sorting of the grid on the other tab.  On Window2 if you sort the grid on one tab the sort is carried over to the other tab.  In my application the other tab doesn't have the same exact grid on it, so it loses it's sort all together.

You may need to click on a tab in Window2 to get data to show.

 

GridInTab.zip
Parents
No Data
Reply
  • 9836
    posted

    This is expected behavior  because of the tabcontrol which creates only one instance of the grid for all of the tabs in the second window. You can check out this forum thread for more details on this issue and some resolution.

Children
No Data