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
138253
How can I perform sorting on the headers of the XamPivotGrid?
posted

    In order to sort the PivotRowHeaders you can use SwithMemberSortDirection() method which takes one parameter form type IMember. In order to sort the Name column (currently placed on the row axis) you can specify as parameter of this method the member that is placed over the whole row hierarchy, so you can use the index of the last tuple of the hierarchy. To achieve this functionality you should specify the suitable hierarchy on levels and expand it.

(pivotGrid.DataSource as FlatDataSource).SwitchMemberSortDirection(pivotGrid.DataSource.Result.RowAxis.Tuples[pivotGrid.DataSource.Result.RowAxis.Tuples.Count-1].Members[0]);

sortPG.zip