Back to Devexpress

FilterDateRangeItem Class

maui-devexpress-dot-maui-dot-editors-c13768dd.md

latest5.8 KB
Original Source

FilterDateRangeItem Class

A filter item that allows you to filter data control items by date-time range values.

Namespace : DevExpress.Maui.Editors

Assembly : DevExpress.Maui.Editors.dll

NuGet Package : DevExpress.Maui.Editors

Declaration

csharp
[DXLicenseMAUI]
public class FilterDateRangeItem :
    FilterRangeItemBase

Remarks

The image below shows a sample date-range filter item:

To use a FilterDateRangeItem in your filtering UI, bind its Context property to the data control’s FilteringContext (DataGridView.FilteringContext or DXCollectionView.FilteringContext). Then specify the FilterDateRangeItem’s FieldName property to set by which data source property values the data control should filter its items:

xaml
<ContentPage ...
             xmlns:dxe="clr-namespace:DevExpress.Maui.Editors;assembly=DevExpress.Maui.Editors">
             <!--...-->
                <dxe:FilterDateRangeItem Context="{Binding}" Text="Order Date" FieldName="Date"/>
             <!--...-->
</ContentPage>
csharp
FilterPage FilterPage => filterPage ??= new FilterPage() { BindingContext = dataControl.FilteringContext };

To set a format for dates, specify the EditorDisplayFormat property.

Use the Max and Min properties to specify the maximum and minimum dates that users can specify in the filter. If values of these properties are null, they are set to maximum/minimum dates that are available in the bound data source.

You can also replace the default editor with a custom editor. To do so, specify the FilterDateRangeItem’s FilterModelTemplate property. Use the FilterDateRangeItem’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:

Implements

Show 17 items

INotifyPropertyChanged

IAnimatable

Microsoft.Maui.Controls.ITabStopElement

IViewController

IVisualElementController

IElementController

IGestureController

IGestureRecognizers

IPropertyMapperView

IHotReloadableView

IView

IReplaceableView

ILayout

ILayoutController

Microsoft.Maui.IFrameworkElement

ITransform

IContainer

Inheritance

Show 12 items

System.Object BindableObject Element NavigableElement VisualElement View Layout DevExpress.Maui.Editors.Internal.BaseFormItem FormItemBase FilterFormItemBase FilterRangeItemBase FilterDateRangeItem

Extension Methods

Yield<FilterDateRangeItem>()

YieldIfNotNull<FilterDateRangeItem>()

See Also

FilterDateRangeItem Members

DevExpress.Maui.Editors Namespace