Skip to main content
All docs
V26.1
  • DateRangeFilterModelTemplateSelector.DateTimeRangeTemplate Property

    Gets or sets the template that is applied when the active filter model is DateRangeFilterModel. This is a dependency property.

    Namespace: DevExpress.Xpf.Core.FilteringUI

    Assembly: DevExpress.Xpf.Grid.v26.1.dll

    Declaration

    public DataTemplate DateTimeRangeTemplate { get; set; }

    Property Value

    Type Description
    DataTemplate

    A DataTemplate applied when the active filter model is DateRangeFilterModel.

    Remarks

    The following example applies the DateTimeRangeTemplate to the DateRangeFilterElement that filters the ShipDateTime column of the DateTime type:

    <Window.Resources>
        <!-- DateTime Range Template -->       
        <DataTemplate x:Key="MyDateTimeRangeTemplate">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="From:"/>
                <dxe:DateEdit EditValue="{Binding From, Mode=TwoWay}"
                              MaskType="DateTime"/>
                <TextBlock Text="To:"/>
                <dxe:DateEdit EditValue="{Binding To, Mode=TwoWay}"
                              MaskType="DateTime"/>
            </StackPanel>
        </DataTemplate>
    </Window.Resources>
    
    <dxfui:DateRangeFilterElement x:Name="dateRangeFilter"
                                  FieldName="ShipDateTime"
                                  Context="{Binding FilteringContext, ElementName=grid}">
        <dxfui:DateRangeFilterElement.FilterModelTemplateSelector>
            <dxfui:DateRangeFilterModelTemplateSelector
                DateTimeRangeTemplate="{StaticResource MyDateTimeRangeTemplate}"/>
        </dxfui:DateRangeFilterElement.FilterModelTemplateSelector>
    </dxfui:DateRangeFilterElement>
    
    <dxg:GridControl x:Name="grid" 
                     ItemsSource="{Binding Orders}">
        <dxg:GridControl.Columns>
            <dxg:GridColumn FieldName="OrderDate" Header="Order Date"/>
            <dxg:GridColumn FieldName="ShipDateTime" Header="Ship Date &amp; Time"/>
            <dxg:GridColumn FieldName="DeliveryDate" Header="Delivery Date"/>
            <dxg:GridColumn FieldName="ProcessingTime" Header="Processing Time"/>
        </dxg:GridControl.Columns>
            <dxg:GridControl.View>
                <dxg:TableView .../>
            </dxg:GridControl.View>
    </dxg:GridControl>
    
    See Also