We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to sort the month values of a PivotColumn/PivotRow?

By default, the PivotColumns or PivotRows are loaded in ascending order. So, the month values are loaded as April, August, February, etc., instead of January, February, March, etc., In order to sort the month values in default order, the IComparer interface can be implemented.

 

This customized sorting can be done by having a user-defined class that implements the IComparer interface and writing the custom comparer code in the Compare() method and the CustomComparer can be added to the PivotRows/PivotColumns by using Comparer field of PivotItem.

 

Code snippet

C#

 

VB

 

Screenshot

 

Sample links

CS: CustomSorting_CS

VB: CustomSorting_VB

Article ID: Published Date: Last Revised Date: Platform: Control:
8072 11/15/2017 11/15/2017 WinForms PivotGridControl
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon