Skip to main content

CardViewColumn.SortOrder Property

Gets or sets the column’s sort order.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web


public virtual ColumnSortOrder SortOrder { get; set; }

Property Value

Type Default Description
ColumnSortOrder None

A ColumnSortOrder enumeration value that specifies the column’s sort order.

Available values:

Name Description

No sorting is applied to a column.


Sorts the column in ascending order.


Sorts the columns in descending order.


Read the SortOrder property’s value to determine which sort order is currently applied to the column. Assign a value to this property to sort data by the current column’s values.

You can also use the CardViewColumn.SortAscending and CardViewColumn.SortDescending methods to specify the desired sort order. To clear sorting, use the CardViewColumn.UnSort method.

Any previous sorting is not cleared when changing the SortOrder property’s value. The new sort order applies an additional sorting condition to the one previously applied. The newly sorted column is added to the collection of sorted columns. Its index within the collection can be obtained using the CardViewColumn.SortIndex property. The number of sorted columns is returned by the ASPxGridBase.SortCount property.

Sorting is allowed if the ASPxGridBehaviorSettings.AllowSort property is set to true.


Web Forms approach:


For a full example, see the CardView - Sorting (Web Forms) demo.

<dx:ASPxCardView ID="ASPxCardView1" runat="server" DataSourceID="HomesDataSource" 
    EnableCardsCache="false" Width="100%">
        <dx:CardViewTextColumn FieldName="Price" SortOrder="Ascending">
            <PropertiesTextEdit DisplayFormatString="c" />
        <dx:CardViewImageColumn FieldName="PhotoUrl" Settings-AllowSort="False">
            <PropertiesImage ImageWidth="250" />
    <CardLayoutProperties ColCount="2">

MVC approach:


For a full example, see the CardView - Sorting (MVC) demo.

@Html.DevExpress().CardView( settings => {
    settings.Name = "CardView";
    settings.Columns.Add(c =>{
        c.FieldName = "Price";
        c.SortOrder = ColumnSortOrder.Ascending;
        c.PropertiesEdit.DisplayFormatString = "c";
    settings.Columns.Add(c => {
        c.FieldName = "PhotoUrl";
        c.ColumnType = MVCxCardViewColumnType.Image;
        ((ImageEditProperties)c.PropertiesEdit).ImageWidth = 250;


Online Demos

See Also