Back to Devexpress

IModelListView.Criteria Property

expressappframework-devexpress-dot-expressapp-dot-model-dot-imodellistview-c59f81cf.md

latest2.8 KB
Original Source

IModelListView.Criteria Property

Specifies the criteria according to which the current List View is filtered.

Namespace : DevExpress.ExpressApp.Model

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
[CriteriaOptions("ModelClass.TypeInfo")]
string Criteria { get; set; }
vb
<CriteriaOptions("ModelClass.TypeInfo")>
Property Criteria As String

Property Value

TypeDescription
String

A string specifying the criteria according to which the current List View is filtered.

|

Remarks

For additional information, refer to the Criteria Property in the Application Model and Ways to Build Criteria help topics.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Criteria 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.

XAF-How-to-show-the-number-of-list-view-items-in-the-navigation-control/CS/XPO/ItemCount/ItemCount.Module/Controllers/NavigationObjectCountController.cs#L26

csharp
IModelListView modelListView = (IModelListView)e.ModelNavigationItem.View;
int objectsCount = objectSpace.GetObjectsCount(typeof(Email), CriteriaOperator.Parse(modelListView.Criteria));
e.NavigationItem.Caption = "Inbox" + (objectsCount > 0 ? $" ({objectsCount})" : string.Empty);

See Also

Data Filtering

IModelListView Interface

IModelListView Members

DevExpress.ExpressApp.Model Namespace