Skip to main content
.NET Framework 4.5.2+

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.v24.1.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public interface IModelSorting :
    IModelNode,
    IModelList<IModelSortProperty>,
    IList<IModelSortProperty>,
    ICollection<IModelSortProperty>,
    IEnumerable<IModelSortProperty>,
    IEnumerable

Remarks

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.

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