IModelSorting Interface

The Sorting node provides access to the sort settings applied to the collection of the List View's Collection Source.

Namespace: DevExpress.ExpressApp.Model

Assembly: DevExpress.ExpressApp.v18.2.dll

Declaration

public interface IModelSorting :
    IModelNode,
    IModelList<IModelSortProperty>,
    IList<IModelSortProperty>,
    ICollection<IModelSortProperty>,
    IEnumerable<IModelSortProperty>,
    IEnumerable
Public Interface IModelSorting
    Inherits IModelNode,
             IModelList(Of IModelSortProperty),
             IList(Of IModelSortProperty),
             ICollection(Of IModelSortProperty),
             IEnumerable(Of IModelSortProperty),
             IEnumerable

This interface is a part of the Application Model infrastructure. You do not need to implement this interface in most cases.

Important

Sorting, specified in the IModelSorting node is applied to the underlying data source. It may be overridden by sorting specified for the bound control (see IModelColumn.SortOrder).

The IModelSorting node represents a list of the IModelSortProperty nodes. You can add SortProperty child nodes to specify sorting applied to the collection of the List View's Collection Source. For instance, this setting has effect when the IModelListView.TopReturnedObjects property is specified. An example is available in the XCRM demo (see the Views | ITop5Customers_ListView node). This demo is located in the %PUBLIC%\Documents\DevExpress Demos 18.2\Components\eXpressApp Framework\XCRM folder.

Settings specified in the IModelSorting node have no effect in List Views where the PropertyCollectionSource is used. Nested List Views of collection properties and lookup List Views of properties decorated with the DataSourceProperty attribute use this Collection Source. In the PropertyCollectionSource class, the CollectionSourceBase.CanApplySorting default value is set to false to avoid overriding the sorting specified in a collection property getter accidentally. To change the CanApplySorting value to true, use the following View Controller:

using DevExpress.ExpressApp;
// ...
public class MyViewController : ViewController<ListView> {
    public MyViewController() {
        this.TargetObjectType = typeof(MyBusinessObject);
        this.TargetViewNesting = DevExpress.ExpressApp.Nesting.Nested;
    }
    protected override void OnActivated() {
        base.OnActivated();
        this.View.CollectionSource.CanApplySorting = true;
    }
}
See Also