maui-devexpress-dot-maui-dot-editors-967527c1.md
A filter item that allows you to toggle a switch to filter data control items by boolean values.
Namespace : DevExpress.Maui.Editors
Assembly : DevExpress.Maui.Editors.dll
NuGet Package : DevExpress.Maui.Editors
[DXLicenseMAUI]
public class FilterSwitchItem :
FilterCheckItemBase
The image below shows a sample filter item with a switch:
To use a FilterSwitchItem in your filtering UI, bind its Context property to the data control’s FilteringContext (DataGridView.FilteringContext or DXCollectionView.FilteringContext). Then specify the FilterSwitchItem’s FieldName property to set by which data source property values the data control should filter its items:
<ContentPage ...
xmlns:dxe="clr-namespace:DevExpress.Maui.Editors;assembly=DevExpress.Maui.Editors">
<!--...-->
<dxe:FilterSwitchItem Context="{Binding}"
Text="Must have garage"
FieldName="IsGarageExist"/>
<!--...-->
</ContentPage>
FilterPage FilterPage => filterPage ??= new FilterPage() { BindingContext = dataControl.FilteringContext };
You can also replace the default editor with a custom editor. To do so, specify the FilterSwitchItem’s FilterModelTemplate property. Use the FilterSwitchItem’s FilterModel property to obtain the binding context for the template.
For more information on how to implement a Filtering UI for DataGridView and DXCollectionView, refer to the following sections:
Show 17 items
Microsoft.Maui.Controls.ITabStopElement
Microsoft.Maui.IFrameworkElement
Show 12 items
System.Object BindableObject Element NavigableElement VisualElement View Layout DevExpress.Maui.Editors.Internal.BaseFormItem FormItemBase FilterFormItemBase FilterCheckItemBase FilterSwitchItem
YieldIfNotNull<FilterSwitchItem>()
See Also