maui-devexpress-dot-maui-dot-collectionview-dot-dxcollectionview-e71e7a18.md
Returns the data context that is used to bind filter items to the Collection View.
Namespace : DevExpress.Maui.CollectionView
Assembly : DevExpress.Maui.CollectionView.dll
NuGet Package : DevExpress.Maui.CollectionView
public FilteringUIContext FilteringContext { get; }
| Type | Description |
|---|---|
| FilteringUIContext |
A context that is used to connect the data control and filter items.
|
The DevExpress suite for MAUI allows you to use built-in filter items to design a functional and effective filtering UI. You can easily integrate such a UI with the CollectionView, because it publishes a dedicated FilteringContext property. When you populate a filter view with items, bind each item’s Context property to the CollectionView’s FilteringContext. Once users have interacted with the items, the resulting filter rule is available in the FilterExpression property.
Filter items are separate controls within your application that automatically retrieve available values, format settings, and other information from the bound control – CollectionView. The following filter items are available:
FilterCheckItem – Allows users to use a checkbox to filter by Boolean values.
FilterSwitchItem – Allows users to use a switch to filter by Boolean values.
FilterChipGroupItem – Allows users to select a single option from a set.
FilterCheckedChipGroupItem – Allows users to check multiple options from a set.
PredefinedFilterCheckedChipGroupItem – Allows users to check multiple predefined options from a set.
FilterDateRangeItem – Allows users to filter by date-time values.
FilterNumericRangeItem – Allows users to specify a value range to filter numeric values.
FilterNumericRangeSliderItem – Allows users to select a value range to filter numeric values.
FilterRadioListItem – Allows users to select a single option from a radio-button list. Users can enter a search query in the search box to filter available options.
FilterCheckedListItem – Allows users to select multiple options from a checkbox list. Users can enter a search query in the search box to filter available options.
FilterRadioListPickerItem – Allows users to select a single option from a list shown in a separate dialog. Users can enter a search query in the search box to filter available options.
FilterCheckedListPickerItem – Allows users to select multiple options from a list shown in a separate dialog. Users can enter a search query in the search box to filter available options.
You can customize the value picker used in a built-in filter item. Depending on the filter item, use the following properties to implement a custom picker:
The following example shows how to design a filtering UI for a DXCollectionView. You need to populate a view with filter items and set their Context properties to the collection view’s FilteringContext. For each filter item, specify the FilterItemBase.FieldName property so that an item can obtain its values from the corresponding data field.
<VerticalStackLayout>
<!-- The BindingContext contains the DXCollectionView.FilteringContext property value -->
<dxe:FilterRadioListPickerItem Context="{Binding}" FieldName="City" ImageSource="filteringui_location" ImageColor="{DynamicResource AccentColor}"/>
<dxe:FilterChipGroupItem Context="{Binding}" Text="Property Status" FieldName="Status" CustomDisplayText="OnCustomDisplayText"/>
<dxe:FilterCheckedChipGroupItem Context="{Binding}" Text="Property Type" FieldName="Type" CustomDisplayText="OnCustomDisplayText"/>
<dxe:FilterNumericRangeFormItem Context="{Binding}" Text="Price" FieldName="Price2"/>
<dxe:FilterNumericRangeFormItem Context="{Binding}" Text="Square Feet" FieldName="HouseSize"/>
<dxe:FilterCheckedChipGroupItem Context="{Binding}" Text="Bedrooms" FieldName="Beds"/>
<dxe:FilterNumericRangeFormItem Context="{Binding}" Text="Year Built" FieldName="YearBuilt"/>
<dxe:FilterCheckItem Context="{Binding}" Text="Must have garage" FieldName="IsGarageExist"/>
</VerticalStackLayout>
See Also
Filter, Sort, and Group Data in Collection View for .NET MAUI