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: November 16, 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?

Platform: WinForms |
Control: PivotGridControl |
Published Date: November 15, 2017 |
Last Revised Date: November 15, 2017
Tags: sorting

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







Sample links

CS: CustomSorting_CS

VB: CustomSorting_VB

You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

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