Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Collapse]Concepts
  [Expand]Application Solution Components
  [Collapse]Business Model Design
    Business Model Design Basics
    Built-in Business Classes for Most Popular Scenarios
   [Expand]Business Model Design with Entity Framework
   [Expand]Business Model Design with XPO
    Non-Persistent Objects
    PropertyChanged Event in Business Classes
   [Collapse]Data Types Supported by built-in Editors
     Key Properties
    [Expand]String Properties
    [Expand]Numeric Properties
    [Expand]Date and Time Properties
    [Expand]Boolean Properties
    [Expand]BLOB Image Properties
    [Expand]Collection Properties
    [Expand]Reference (Foreign Key, Complex Type) Properties
    [Expand]File Attachment Properties
    [Expand]Type Properties
    [Expand]Enumeration Properties
    [Collapse]Criteria Properties
      Criteria Properties in XPO
      Criteria Properties in Entity Framework
      Criteria Properties in Domain Components
    [Expand]Color Properties
     Geolocation Properties
     Miscellaneous Property Types
    Mapping Complex Types to the Database
   [Expand]Types Info Subsystem
    Connect an XAF Application to a Database Provider
    Data Annotations in Data Model
    Create and Update the Application's Database
  [Expand]Application Model
  [Expand]UI Construction
  [Expand]Extend Functionality
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]Localization
  [Expand]System Module
  [Expand]Extra Modules
  [Expand]Debugging and Error Handling
  [Expand]Filtering
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Expand]Task-Based Help
 [Expand]Frequently Asked Questions
 [Expand]API Reference
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
[Expand]End-User Documentation

Criteria Properties

A string property that stores a Criteria Language Syntax expression can be displayed from:

  • a Filter Builder control;
  • an editor that allows end users to type a criteria manually and display a Filter Builder in a pop-up.

Windows Forms

ASP.NET

Note

To see Criteria Property Editors in action, refer to the Property Editors | Criteria Properties section in the Feature Center demo installed with XAF. By default, the Feature Center demo is installed in %PUBLIC%\Documents\DevExpress Demos 17.1\Components\eXpressApp Framework\FeatureCenter. The ASP.NET version of this demo is available online at http://demos.devexpress.com/XAF/FeatureCenter/.

Expanded Examples

Expanded Windows Forms Property Editors for Criteria Properties

Each WinForms Property Editor has a control that displays a corresponding property in a Detail View, and a repository item that displays a property in a List Editor that supports in-place editing. The table below shows both the control and repository item.

.
Property Editor Type and Description Control Repository Item

CriteriaPropertyEditor

Intended for string properties that store filter criteria. This Property Editor allows end-users to construct the filter criteria using a Filter Builder control in a Filter tab, or by typing text in the Text tab.

String properties that store filter criteria must be decorated with CriteriaOptionsAttribute. By default, in Windows Forms applications, these properties are represented by this Property Editor.

To see an example of using Criteria Property Editors, refer to the How to: Use Criteria Property Editors topic.

FilterEditorControl There is no specific repository item.

PopupCriteriaPropertyEditor

Intended for string properties that store filter criteria. This Property Editor allows end-users to construct filter criteria in a separate window to conserve space in the detail form. This window displays the CriteriaPropertyEditor.
To use this Property Editor, assign it to the PropertyEditorType property of the required BOModel | <Class> | OwnMembers | <Member> node or Views | <DetailView> | Items | <PropertyEditor> node.
The property that is displayed by this Property Editor must be decorated with CriteriaOptionsAttribute.

To see an example of how to use Criteria Property Editors, refer to the How to: Use Criteria Property Editors topic.

PopupCriteriaPropertyEditor creates a pop-up Detail View with the CriteriaPropertyEditor item, which uses the FilterEditorControl component internally. To access FilterEditorControl options, use the approach similar to described in the Access Editor Settings tutorial - implement a View Controller for the Detail View of the DevExpress.ExpressApp.Editors.CriteriaProvider type and access the CriteriaPropertyEditor.Control property.

FilterEditorControl RepositoryItemPopupCriteriaEdit - a descendant of the RepositoryItemButtonEdit repository item from the XtraEditors Library

Expanded ASP.NET Property Editors for Criteria Properties

Each ASP.NET Property Editor has controls that display a property in a Detail View's View mode and in an Edit mode (see DetailView.ViewEditMode). These controls are listed in the table below.

Property Editor Type and Description

Control Used in View Mode

Control Used in Edit Mode

ASPxCriteriaPropertyEditor

Intended for string properties that store filter criteria. This Property Editor allows end-users to construct the filter criteria using a Filter Builder control in a Filter tab, or by typing text in the Text tab.

String properties that store filter criteria must be decorated with CriteriaOptionsAttribute. By default, these properties are represented by this Property Editor in ASP.NET Web applications.

To see an example of how to use Criteria Property Editors, refer to the How to: Use Criteria Property Editors topic.

System.Web.UI.WebControls.Label ASPxFilterControl

ASPxPopupCriteriaPropertyEditor

Intended for string properties that store filter criteria. This Property Editor allows end-users to construct filter criteria in a separate window to conserve space in a detail form. This window displays ASPxCriteriaPropertyEditor. To use this Property Editor, set it for the PropertyEditorType property of the required BOModel | <Class> | OwnMembers | <Member> node or Views | <DetailView> | Items | <PropertyEditor> node.

String properties that store filter criteria must be decorated with CriteriaOptionsAttribute.

To see an example of how to use Criteria Property Editors, refer to the How to: Use Criteria Property Editors topic.

System.Web.UI.WebControls.Label ASPxButtonEdit

Expanded Criteria Property Editors Options in ASP.NET Applications

When you edit criteria using the Visual tab, you can either select object properties in a plain list or in the tree-like structure (which makes referenced objects' properties available).

Both ASPxCriteriaPropertyEditor and ASPxPopupCriteriaPropertyEditor editors expose the following properties.

Property Type Description
AllowFilterControlHierarchy Boolean Specifies whether or not the hierarchy tree is displayed for the reference properties.
MaxHierarchyDepth Int32 Specifies the maximum hierarchy depth level that can be displayed when AllowFilterControlHierarchy is enabled.
Note

You can also use similar options of the ASPxGridListEditor to adjust the behavior of the grid's filter control:

To change these options for an individual editor, use the following Controller:

To change these options globally, for all ASPxCriteriaPropertyEditor and ASPxPopupCriteriaPropertyEditor editors in your application, use the following static properties.

  • ASPxCriteriaPropertyEditor.AllowFilterControlHierarchyDefault
  • ASPxCriteriaPropertyEditor.MaxHierarchyDepthDefault

Additionally, you can use the static ASPxCriteriaPropertyEditor.AlwaysShowKeyPropertyInFilterControl property. It specifies if the key property is visible in the ASPxFilterControl even if the Browsable(false) attribute is applied. The default value is true.

As these properties are static, you can access them from any appropriate location in your code (e.g., from the WebApplication constructor).

Expanded Criteria Property Editors Limitations in ASP.NET Applications

  • The persistent objects can be used in the criteria construction (in this example it is the Manager reference property of the Person type). Reference properties are displayed via a Lookup Property Editor in the Windows Forms application. By default, this Lookup List View contains a single column with the object's default property. You can add more columns by decorating the required properties with the VisibleInLookupListViewAttribute, or by adding columns to the corresponding Lookup List View in the Model Editor. However, in an ASP.NET application, lookup property editors are represented by combo boxes, by default. Currently, you cannot use a complex lookup editor within the ASP.NET Criteria Editors:

  • You cannot use the Equals operator and choose reference property values from a lookup when the AllowFilterControlHierarchy property is set to true.

  • In ASP.NET Criteria Property Editors, certain Function Criteria Operators can be used in the Text tab only.

How would you rate this topic?​​​​​​​