Sorting Capability

Is there a way to customize the sort on certain columns? I am unsure of exactly how it is sorting, the ascending works correctly but it does not appear that the descending is working correctly, can i customize this within a certain event to handle it.


Well, GridWeb's data sorting feature just works fine in both ascending and descending orders. You may use WebCells.Sort() method to include your desired columns in sorting range. I think you can try to add CellCommand Hyperlinks as a data sorting headers and handle GridWeb1_CellCommand event for your need.

Following code just sort the data in descending order, the data sort column is A here.

Sample code:

//Accessing the reference of the worksheet that is currently active
WebWorksheet sheet=GridWeb1.WebWorksheets[GridWeb1.ActiveSheetIndex];
//Sorting data in descending order from top to bottom, the data sorting range is A2:B13 and the
//sort column is A here (the fifth argument in the Sort() method i.e.., 0 denotes A column).

For further reference, please check the source codes of the Data Sorting featured demo:

The demo projects get installed automatically on your system when you install Aspose.Grid.MSI installer, so you may open the projects into VS.NET and check the source codes.

Also, please check the doc topic:

Moreover, don't forget to use the latest version (2.0.0) of the control.

If you still find any issue, kindly do create a test project, zip it and post it here, we will check it soon.

Thank you.