Log In
[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]Report Server
[Collapse]eXpressApp Framework
 [Expand]Getting Started
  [Expand]Application Solution Components
  [Expand]Business Model Design
  [Expand]Application Model
  [Expand]UI Construction
  [Expand]Extend Functionality
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]System Module
  [Expand]Extra Modules
  [Expand]Debugging and Error Handling
    Criteria Property of a List View's Collection Source
    Criteria Property in the Application Model
    Filters Application Model Node
    ListViewFilter Attribute
    FullTextSearch Action
    UI-Specific Filtering Techniques
    Adjust Data Sources for Reference and Collection Properties
    Ways to Build Criteria
    Object Parameters
    Current Object Parameter
    Function Criteria Operators
    Custom Function Criteria Operators
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Task-Based Help
 [Expand]Frequently Asked Questions
 [Expand]API Reference
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Criteria Property of a List View's Collection Source

The CollectionSourceBase.Criteria property of a List View's ListView.CollectionSource allows you to filter the List View on the data source level. This means that only objects that satisfy the specified criteria are retrieved from the database. Use this approach if you need to apply a filter, which will not be changed at run time or design time. This topic explains how to use this approach.

To access the Criteria property of a List View's CollectionSource, do the following.

With the following code, Person List Views will contain objects whose FullName begins with an "A":

This approach can be applied to any List View, whether it is a root, nested, in a Lookup Property Editor's drop-down window, or a Link Action's pop-up window - any List View that you can define in code. In the code above, all List Views that display Person type objects will be filtered.

If a persistent object is used in a Collection Source's Criteria, this object is not reloaded when the Object Space is refreshed, and thus the SessionMixingException occurs. Use a persistent object's key property instead of the object itself.


  • In nested List Views, the Criteria is not directly applied to the associated collection. Instead, a separate collection is created and the criteria is applied to it. The original associated collection is not modified. The exception is the nested List View in the Client data access mode with proxy collection disabled (see XafApplication.DefaultCollectionSourceMode). In this instance, the criteria is directly applied to the associated collection.

  • Currently, TreeListEditor has limited filtering capabilities. When a Collection Source is used by a List View visualized via TreeListEditor, specifying the Collection Source's Criteria property will affect only root tree nodes. Child nodes will not be filtered.

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