Back to Devexpress

ODataInstantFeedbackSource.DefaultSorting Property

corelibraries-devexpress-dot-data-dot-odatalinq-dot-odatainstantfeedbacksource-04a40db6.md

latest2.5 KB
Original Source

ODataInstantFeedbackSource.DefaultSorting Property

Specifies how data source contents are sorted by default when the sort order is not specified by the bound control.

Namespace : DevExpress.Data.ODataLinq

Assembly : DevExpress.Data.v25.2.dll

NuGet Package : DevExpress.Data

Declaration

csharp
[DefaultValue("")]
public string DefaultSorting { get; set; }
vb
<DefaultValue("")>
Public Property DefaultSorting As String

Property Value

TypeDefaultDescription
StringString.Empty

The string which contains the column name(s) against which data source contents are sorted and the sort order(s).

|

Remarks

This property accepts a string containing a column name followed by the sort order - “ASC” (ascending) or “DESC” (descending).

csharp
dataSource.DefaultSorting = "UnitPrice DESC";
vb
dataSource.DefaultSorting = "UnitPrice DESC"

Columns are sorted ascending by default - “ASC” can be omitted.

csharp
dataSource.DefaultSorting = "Name";
vb
dataSource.DefaultSorting = "Name"

Multiple columns can be separated by semicolons.

csharp
dataSource.DefaultSorting = "UnitPrice DESC; Name";
vb
dataSource.DefaultSorting = "UnitPrice DESC; Name"

Note

The DefaultSorting property must be specified before the ODataInstantFeedbackSource is bound to a data-aware control.

See Also

ODataInstantFeedbackSource Class

ODataInstantFeedbackSource Members

DevExpress.Data.ODataLinq Namespace