Back to Devexpress

CustomColumnSortEventArgs.SortOrder Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-customcolumnsorteventargs-86aa4e16.md

latest3.3 KB
Original Source

CustomColumnSortEventArgs.SortOrder Property

Gets the current sort order applied to the column being processed.

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
public ColumnSortOrder SortOrder { get; }
vb
Public ReadOnly Property SortOrder As ColumnSortOrder

Property Value

TypeDescription
ColumnSortOrder

A ColumnSortOrder value representing the column’s sort order.

|

Available values:

NameDescription
None

No sorting is applied to a column.

| | Ascending |

Sorts the column in ascending order.

| | Descending |

Sorts the columns in descending order.

|

Remarks

The SortOrder property indicates the sort order (ascending or descending) applied to the column being processed.

When handling the GridView.CustomColumnGroup event the SortOrder property is always set to ColumnSortOrder.None.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SortOrder property.

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.

winforms-grid-display-custom-rows/CS/CustomRowInGrid/CustomRowInGrid/Form1.cs#L52

csharp
{
    if (e.SortOrder == DevExpress.Data.ColumnSortOrder.Ascending)
        e.Result = 1;

winforms-grid-display-custom-rows/VB/CustomRowInGrid/Form1.vb#L48

vb
If (row1.ID < 0) AndAlso (row2.ID >= 0) Then
    If e.SortOrder = DevExpress.Data.ColumnSortOrder.Ascending Then
        e.Result = 1

See Also

CustomColumnSort

CustomColumnSortEventArgs Class

CustomColumnSortEventArgs Members

DevExpress.XtraGrid.Views.Base Namespace