DxComboBoxSettings.FilteringMode Property
Specifies whether and how the combo box editor filters its data.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v23.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[DefaultValue(DataGridFilteringMode.None)]
[Parameter]
public DataGridFilteringMode FilteringMode { get; set; }
Property Value
Type | Default | Description |
---|---|---|
DataGridFilteringMode | None | An enumeration value. |
Available values:
Name | Description |
---|---|
None | The filter is not applied to list items. |
StartsWith | Filters the component for list items that begin with the search string. |
Contains | Filters the component for list items that contain the search string. Search string matches are highlighted. |
Remarks
Use the FilteringMode
property to enable filtering in the combo box editor and specify the editor’s filter mode. Once filtering is enabled, the combo box dynamically filters its items based on the typed text and highlights the first match. Users can press the Enter key to select the highlighted value.
Note
A multi-column combo box applies the filter condition only to the columns displayed in the edit value.
The example below demonstrates how to filter out all list items in the combo box editor that do not start with the search string:
@inject IDbContextFactory<NorthwindContext> NorthwindContextFactory
<DxGrid Data="Products"
EditMode="GridEditMode.EditRow">
<Columns>
<DxGridCommandColumn />
<DxGridDataColumn FieldName="CategoryId" Caption="Category">
<EditSettings>
<DxComboBoxSettings Data="Categories"
ValueFieldName="CategoryId"
TextFieldName="CategoryName"
FilteringMode="DataGridFilteringMode.StartsWith"/>
</EditSettings>
</DxGridDataColumn>
<DxGridDataColumn FieldName="ProductName" Width="25%"/>
<DxGridDataColumn FieldName="UnitPrice" />
<DxGridDataColumn FieldName="UnitsInStock" />
<DxGridDataColumn FieldName="QuantityPerUnit" />
</Columns>
</DxGrid>
@code {
NorthwindContext Northwind { get; set; }
List<Product> Products { get; set; }
List<Category> Categories { get; set; }
protected override async Task OnInitializedAsync() {
Northwind = NorthwindContextFactory.CreateDbContext();
Products = await Northwind.Products.ToListAsync();
Categories = await Northwind.Categories.ToListAsync();
}
public void Dispose() {
Northwind?.Dispose();
}
}
To change the combo box editor’s filter mode at runtime, use the IComboBoxSettings.FilteringMode property.