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
332
Sorting don't apply at runtime.
posted

Hi,

I am saving last sorting applied of pivot grid in xml. I want to apply this sorting on users next login. Sorting is saved properly but I was unable to apply this sorting at runtime. I refer the pivot grid documentation for sorting and trying exactly same thing but that is not working. My code snippet is as follow:

 ISortableOlapDatasource sortDesriptorColl = (MyDashboard.pivotGrid.DataSource as ISortableOlapDatasource);

 

 

foreach (ITuple tuple in MyDashboard.pivotGrid.DataSource.Result.ColumnAxis.Tuples) {

 

 

if (sortedColumnUniqueName == tuple.Members[0].UniqueName){

 

 

if (sortedItem != null && sortedItem.HasValue) {

 

 

if (sortDesriptorColl != null) {

sortDesriptorColl.SortDescriptors.Add(new KeyValuePair<ITuple, SortDirection>(MyDashboard.pivotGrid.DataSource.Result.RowAxis.Tuples[0], sortedItem.Value.SortDirection));}}}}

This code run without any error but sorting didn't apply. If I expand the hierarchy of sorted column then it will apply automatically.