corelibraries-devexpress-dot-data-dot-linq-dot-entityservermodesource.md
Specifies how data source contents are sorted by default, when the sort order is not specified by the bound control.
Namespace : DevExpress.Data.Linq
Assembly : DevExpress.Data.v25.2.dll
NuGet Package : DevExpress.Data
[DefaultValue("")]
public string DefaultSorting { get; set; }
<DefaultValue("")>
Public Property DefaultSorting As String
| Type | Default | Description |
|---|---|---|
| String | String.Empty |
The string which contains the column name(s) against which data source contents are sorted and the sort order(s).
|
This property accepts a string containing a column name followed by the sort order - “ASC” (ascending) or “DESC” (descending).
dataSource.DefaultSorting = "UnitPrice DESC";
dataSource.DefaultSorting = "UnitPrice DESC"
Columns are sorted ascending by default - “ASC” can be omitted.
dataSource.DefaultSorting = "Name";
dataSource.DefaultSorting = "Name"
Multiple columns can be separated by semicolons.
dataSource.DefaultSorting = "UnitPrice DESC; Name";
dataSource.DefaultSorting = "UnitPrice DESC; Name"
See Also