Skip to main content
All docs
V25.1
  • DxFilterBuilderField.AllowSelection Property

    Specifies whether the field can be selected.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    [DefaultValue(true)]
    [Parameter]
    public bool AllowSelection { get; set; }

    Property Value

    Type Default Description
    Boolean true

    true to allow field selection; otherwise, false.

    Remarks

    The <DxFilterBuilder> component allows users to select fields with mouse clicks, tap gestures, and keyboard shortcuts. To disable selection for a specific field, set its AllowSelection property to false.

    The following code snippet disables selection for the Supplier field. Users cannot build a filter condition with this field, but can expand or collapse it in the tree.

    Filter Builder - Disable Field Selection

    <DxFilterBuilder @bind-FilterCriteria="FilterCriteria">
        <Fields>
            <DxFilterBuilderField FieldName="ProductName" Caption="Product Name" Type="@typeof(string)" />
            <DxFilterBuilderField FieldName="CategoryId" Caption="Category" Type="@typeof(int)">
                <EditSettings>
                    <DxComboBoxSettings Data="Categories" ValueFieldName="CategoryId" TextFieldName="CategoryName" />
                </EditSettings>
            </DxFilterBuilderField>
            <DxFilterBuilderField FieldName="SupplierId" Caption="Supplier" Type="@typeof(int)"
                                  AllowSelection="false">
                <Fields>
                    <DxFilterBuilderField FieldName="Supplier.CompanyName" Caption="Company Name"
                                          CaptionFullPath="Supplier.Company Name" Type="@typeof(string)" />
                    <DxFilterBuilderField FieldName="Supplier.ContactName" Caption="Contact Name"
                                          CaptionFullPath="Supplier.Contact Name" Type="@typeof(string)" />
                </Fields>
            </DxFilterBuilderField>
        </Fields>
    </DxFilterBuilder>
    
    <DxButton Text="Clear" Click="ClearFilterCriteria" RenderStyle="ButtonRenderStyle.Secondary" />
    <DxButton Text="Apply" Click="ApplyFilterCriteria" />
    
    See Also