Sort Worksheet Data
Sorting Data
Aspose.Cells.GridWeb allows developers to sort data horizontally and vertically so that developers can sort data from top to bottom or left to right.
From Top to Bottom
To sort data from top to bottom orientation:
- Add the Aspose.Cells.GridWeb control to your Web Form.
- Access the worksheet that you want to sort.
- Sort the range of data in any order (ascending or descending). Be sure to select top to bottom orientation.
The example below sorts data in four columns of a worksheet in descending order. Only twenty rows of the four columns are sorted in top to bottom orientation.
Before applying the code, the worksheet contains unordered data.
After executing the code, the data is sorted in ascending order.
From Left to Right
To sort data from left to right:
- Add the Aspose.Cells.GridWeb control to your Web Form.
- Access the worksheet that you want to sort.
- Sort the range of data in any order (ascending or descending). Be sure to select left to right.
The example below sorts data in four rows in ascending order. Only four rows of seven columns are sorted left to right.
Before applying the code, the worksheet contains unordered data.
After executing the code, data is sorted in ascending order.