EntityServerModeDataSource.DefaultSorting Property
Specifies how data source contents are sorted, by default, when the sort order is not specified by the bound control. This is a dependency property.
Namespace: DevExpress.Xpf.Core.ServerMode
Assembly: DevExpress.Xpf.Core.v20.2.dll
NuGet Packages: DevExpress.WindowsDesktop.Wpf.Core, DevExpress.Wpf.Core
Declaration
Property Value
Type | Description |
---|---|
String | The string which contains the column name(s) against which data source contents are sorted and the sort order(s). |
Remarks
The DefaultSorting property accepts a string containing a column name followed by the sort order - “ASC” (ascending) or “DESC” (descending).
dataSource.DefaultSorting = "UnitPrice DESC";
Columns are sorted ascending by default - “ASC” can be omitted.
dataSource.DefaultSorting = "Name";
Multiple columns can be separated by semicolons.
dataSource.DefaultSorting = "UnitPrice DESC; Name";
Note
The DefaultSorting property must be specified before the EntityServerModeDataSource is bound to a data-aware control (e.g. DXGrid).
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DefaultSorting 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.