Back to Devexpress

DataSourceCriteriaAttribute.DataSourceCriteria Property

expressappframework-devexpress-dot-persistent-dot-base-dot-datasourcecriteriaattribute.md

latest3.3 KB
Original Source

DataSourceCriteriaAttribute.DataSourceCriteria Property

Returns criteria for filtering the List View displayed in a Lookup Property Editor or invoked by the LinkUnlinkController.LinkAction Action in a popup window.

Namespace : DevExpress.Persistent.Base

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
public string DataSourceCriteria { get; }
vb
Public ReadOnly Property DataSourceCriteria As String

Property Value

TypeDescription
String

A string value representing criteria for filtering the List View displayed in a Lookup Property Editor or invoked by the LinkUnlinkController.LinkAction Action in a popup window.

|

Remarks

The common rules of writing a criteria are described in the Ways to Build Criteria topic. Note that you can use Function Criteria Operators and Current Object Parameter in your criteria.

You can change the criteria specified in code via the BOModel | <Class> | OwnMembers | <Member> node’s IModelCommonMemberViewItem.DataSourceCriteria property in the Model Editor.

The example below demonstrates how you can use DataSourceCriteria to show Contacts that only have the Manager position in a Lookup List View.

csharp
using DevExpress.Persistent.Base;

// ...
public class Contact : Person {
    //...
    [DataSourceCriteria("Position.Title = 'Manager'")]
    public Contact Manager {
        // ...
    }
    // ...
}

For a complete scenario, see Implement Dependent Reference Properties.

See Also

View Items and Property Editors

DataSourceCriteriaAttribute Class

DataSourceCriteriaAttribute Members

DevExpress.Persistent.Base Namespace