Skip to main content
All docs
V25.2
  • DxFilterBuilderField.IsCollection Property

    Specifies whether the field stores object collections.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.2.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    [DefaultValue(false)]
    [Parameter]
    public bool IsCollection { get; set; }

    Property Value

    Type Default Description
    Boolean false

    true if the field stores object collections; otherwise, false.

    Remarks

    Enable the IsCollection property to define a collection field. Such field stores an object collection and supports aggregate operators (functions). Aggregate functions calculate collection summaries and allow users to create filter conditions based on the aggregated results. For example, users can filter out invoices containing fewer than 5 items in the Products field.

    The following aggregate functions are available:

    Exists
    Returns true if the collection contains at least one field (object).
    Count
    Calculates the number of fields (objects) in the collection.
    Avg
    Calculates the average of all values in the collection.
    Sum
    Calculates the total sum of all values in the collection.
    Min
    Returns the minimum value in the collection.
    Max
    Returns the maximum value in the collection.

    For more information about available operators in Blazor Filter Builder, refer to the following article: Filter Operators in Blazor Filter Builder.

    Note

    For a collection field, the Filter Builder automatically sets its Type property to @typeof(List<object>) and hides the nested hierarchy in the UI.

    The following code snippet defines an Orders collection field:

    Filter Builder - Collection Fields

    <DxFilterBuilder @bind-FilterCriteria="FilterCriteria">
        <Fields>
            <DxFilterBuilderField FieldName="ProductName" Caption="Product" Type="@typeof(string)" />
            <DxFilterBuilderField FieldName="UnitPrice" Caption="Unit Price" Type="@typeof(decimal)" />
            <DxFilterBuilderField FieldName="UnitsInStock" Caption="Units In Stock" Type="@typeof(int)" />
            <DxFilterBuilderField FieldName="Orders" Caption="Orders" IsCollection="true">
                <Fields>
                    <DxFilterBuilderField FieldName="OrderDate" Caption="Order Date" Type="@typeof(DateTime?)" />
                    <DxFilterBuilderField FieldName="CustomerName" Caption="Customer" Type="@typeof(string)" />
                    <DxFilterBuilderField FieldName="Quantity" Caption="Quantity" Type="@typeof(int)" />
                </Fields>
            </DxFilterBuilderField>
        </Fields>
    </DxFilterBuilder>
    

    Run Demo: Filter Builder - Collection Fields and Aggregate Operators

    See Also