This is a migrated thread and some comments may be shown as answers.

Custom sorting on pivotgrid on multiple columns

4 Answers 68 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Mohan
Top achievements
Rank 1
Mohan asked on 01 May 2019, 05:03 AM

I have an issue while doing custom sorting( PivotGridSortOrder.None) on pivot grid using multiple columns. 

Issue: Want to use custom sorting for pivotgrid control.
* I have set both the row field (Country field) and column field (StateCode) to PivotGridSortOrder.None so that it does not use ascending or descending sorting instead it will use sorting as per data set provided.
* For country field(Row field) I have following values : Japan, Argentina, Zimbabwe and India, I want pivot grid to display them in same order too and it is working fine.
* For StateCode field (column field), I have following values: Mno, Abc, Zmp and Ctp and I want pivot grid to display them in this order only. But it is not.

* Dataset being returned by SP is attached. refer screenshot.

* Data being displayed on pivot is attached, refer screenshot.

Let me know how to fix it.

4 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 02 May 2019, 11:56 AM
Hi Mohan,

Thanks for the provided explanation and images.

It seems that in the database you have Zmp, Mno, Abc, and Ctp, not Mno, Abc, Zmp and Ctp.

And the pivot grid is displaying exactly that first order.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Mohan
Top achievements
Rank 1
answered on 02 May 2019, 01:35 PM

Hello Eyup,

yeah I understand that but my question is more off, if I still want to achieve the order as i mentioned in my question, do we have any setting/trick to get this done ? 

0
Accepted
Eyup
Telerik team
answered on 07 May 2019, 05:51 AM
Hello Mohan,

This is the current behavior of the pivot grid as stated here:
 "When the None sorting is active, the sort order will be determined by the original sort order from the data source."
https://docs.telerik.com/devtools/aspnet-ajax/controls/pivotgrid/functionality/sorting

You can sort the data coming from your database before passing it to the pivot grid.

You can also log this idea in our public portal:
https://feedback.telerik.com/Project/108

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Mohan
Top achievements
Rank 1
answered on 15 May 2019, 11:11 AM
Yeah. I created fake records in dataset in such a way that displays pivot columns as per my user's wish.
Tags
PivotGrid
Asked by
Mohan
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Mohan
Top achievements
Rank 1
Share this question
or