.NET Standard 2.0+
.NET Framework 4.5.2+
.NET Standard 2.0+

XPView.Criteria Property

Gets or sets the criteria associated with the view.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v20.2.dll


public CriteriaOperator Criteria { get; set; }
Public Property Criteria As CriteriaOperator

Property Value

Type Description

A CriteriaOperator descendant which represents the criteria associated with the view.


Use the Criteria property to change the criteria by which the persistent objects will be filtered while the view is being loaded. Changing this property immediately refreshes the view.

For examples and additional information about filter expressions, see these help topics:


The following sample code demonstrates how to display persons who are older than 30. Only those persistent objects whose Age property's value is greater than 30 are retrieved.

The image below shows the result.


using DevExpress.Xpo;
using DevExpress.Data.Filtering;
// ...
class SampleTable : XPBaseObject {
    private int id;
    private string name;
    private int age;

    SampleTable(Session session) : base(session) {
        this.name = "John";
        this.age = 25;

    public int ID {
        get { return id; }
        set { SetPropertyValue<int>(nameof(ID), id, value); }

    public string Name {
        get { return name; }
        set { SetPropertyValue<string>(nameof(Name), name, value); }

    public int Age {
        get { return age; }
        set { SetPropertyValue<int>(nameof(Age), age, value); }

// ...

xpView1.Criteria = CriteriaOperator.Parse("Age > 30", null);
See Also