Back to Devexpress

DxFilterBuilderField.AllowSelection Property

blazor-devexpress-dot-blazor-dot-dxfilterbuilderfield-1bfeedbd.md

latest2.6 KB
Original Source

DxFilterBuilderField.AllowSelection Property

Specifies whether the field can be selected.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

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

Property Value

TypeDefaultDescription
Booleantrue

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.

razor
<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

DxFilterBuilderField Class

DxFilterBuilderField Members

DevExpress.Blazor Namespace