DateRangeFilterElement Class

A date range filter element that allows a user to specify a date interval.

Namespace: DevExpress.Xpf.Core.FilteringUI

Assembly: DevExpress.Xpf.Grid.v21.2.dll

Declaration

public class DateRangeFilterElement :
    FilterElement

Remarks

Tip

Topic: Filter Elements

Overview

Run Demo: Date Range

The image below shows a date range filter element:

<dxg:GridControl x:Name="grid" ... />
<!-- ... -->
<dxfui:DateRangeFilterElement Context="{Binding FilteringContext, ElementName=grid}" FieldName="SalesDate" /> 

FilterModelTemplate Property

Use the FilterElement.FilterModelTemplate property to specify the filter element template.

Tip

Data Context (Binding Source): DateRangeFilterModel

Run Demo: Date Range - Range Control Template

<dxfui:DateRangeFilterElement FieldName="OrderDate"
                              Context="{Binding ElementName=grid, Path=FilteringContext}">
    <dxfui:DateRangeFilterElement.FilterModelTemplate>
        <DataTemplate>
            <dxe:RangeControl Name="rangeControl" AllowZoom="False"
                              RangeEnd="{Binding Max}" RangeStart="{Binding Min}"
                              SelectionRangeEnd="{Binding To, Mode=TwoWay}"
                              SelectionRangeStart="{Binding From, Mode=TwoWay}">
                <dxe:RangeControl.Client>
                    <dxcr:DateTimeChartRangeControlClient ItemsSource="{Binding FilterValues}"
                                                          ArgumentDataMember="Value" ValueDataMember="Count"
                                                          GridAlignment="Auto">
                        <dxcr:DateTimeChartRangeControlClient.View>
                            <dxcr:RangeControlClientBarView />
                        </dxcr:DateTimeChartRangeControlClient.View>
                    </dxcr:DateTimeChartRangeControlClient>
                </dxe:RangeControl.Client>
            </dxe:RangeControl>
        </DataTemplate>
    </dxfui:DateRangeFilterElement.FilterModelTemplate>
</dxfui:DateRangeFilterElement>

Limitations

The DateRangeFilterElement is not supported in Server Mode.

See Also