Skip to main content
All docs
V25.2
  • Row

    SortState.Sort(Int32, Color, Boolean) Method

    Sorts the specified column in the given order by the selected font color.

    Namespace: DevExpress.Spreadsheet

    Assembly: DevExpress.Spreadsheet.v25.2.Core.dll

    NuGet Package: DevExpress.Spreadsheet.Core

    Declaration

    void Sort(
        int columnIndex,
        Color fontColor,
        bool descendingOrder
    )

    Parameters

    Name Type Description
    columnIndex Int32

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

    fontColor Color

    the font color.

    descendingOrder Boolean

    true to sort in descending order; otherwise, false

    Remarks

    Example

    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 ascending order by font color in column "D".
        Color color = worksheet["D12"].Font.Color;
        worksheet.AutoFilter.SortState.Sort(2, color, false);
    }
    

    The following code snippets (auto-collected from DevExpress Examples) contain references to the Sort(Int32, Color, Boolean) method.

    Note

    The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

    See Also