I want to save sorting state of all HeaderCells, just like i have saved expansion state for each of
them. I am able to apply default sort on each HeaderCell (it is not a ColumnHeader cell. It can be any expandable cell in column header or row header) in XamPivotGrid as below :
var flatDataSource = sender as FlatDataSource;
foreach (var tuple in flatDataSource.Result.ColumnAxis.Tuples) { foreach (var member in tuple.Members) { flatDataSource.SwitchMemberSortDirection(member); } }
foreach (var tuple in flatDataSource.Result.RowAxis.Tuples) { foreach (var member in tuple.Members) { flatDataSource.SwitchMemberSortDirection(member); } }
But the problem here is, i need to somehow get SortDirection of 'member' to save sort settings with view and apply them again while loading view.
Hello Naveen,
I apologize for the late reply. I can say that you can iterate XamPivotGrid’s DataColumns collection and check the IsSorted Property of every item. It can be None, Ascending or Descending.
Hope this helps you.
them. I am able to apply default sort on each HeaderCell in XamPivotGrid as below :
Hello Plamen,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Thank you for your post. I have been looking into it and since the saving and loading is not built-in and the sample uses custom methods to save the UI you can add a method, which iterates through the Columns of the XamPivotGrid and save its IsSorted Property and, when load the view, load this Properties, too. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.