Skip to main content
All docs
V24.1
Row

SortState.Sort(Int32, Fill, Boolean) Method

Sorts the specified column in the given order by the selected fill pattern.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

void Sort(
    int columnIndex,
    Fill fill,
    bool descendingOrder
)

Parameters

Name Type Description
columnIndex Int32

A zero-based index index of the column to sort.

fill Fill

An object that contains fill pattern parameters.

descendingOrder Boolean

true to sort in descending order; otherwise, false

Remarks

Example

using DevExpress.Spreadsheet;

using (var workbook = new Workbook()) {
    workbook.LoadDocument("Document.xlsx");
    Worksheet worksheet = workbook.Worksheets["Regional sales"];
    workbook.Worksheets.ActiveWorksheet = worksheet;

    // Enable filtering for the "B2:E23" cell range.
    CellRange range = worksheet["B2:E23"];
    worksheet.AutoFilter.Apply(range);

    // Sort data in the "B2:E23" range
    // in descending order by column "C".
    Fill color = worksheet["C10"].Fill;
    worksheet.AutoFilter.SortState.Sort(1, color, false);
}
See Also