Skip to main content
A newer version of this page is available. .

RangeFilterDashboardItem.DateTimePeriods Property

Provides access to a collection of date-time periods that can be used to select a predefined range in the Range Filter.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v20.2.Core.dll

NuGet Packages: DevExpress.Dashboard.Core, DevExpress.WindowsDesktop.Dashboard.Core

Declaration

public DateTimePeriodCollection DateTimePeriods { get; }

Property Value

Type Description
DateTimePeriodCollection

A DateTimePeriodCollection object that is a collection of date-time periods.

Example

This code snippet demonstrates how to create predefined DateTime periods for the Range Filter dashboard item.

View Example: How to Bind the Range Filter Dashboard Item to Data at Runtime

using DevExpress.DashboardCommon;
// ...
rangeFilter.DateTimePeriods.AddRange(
    DateTimePeriod.CreateLastYear(),
    DateTimePeriod.CreateNextDays("Next 7 Days", 7),
    new DateTimePeriod
    { Name = "Month To Date",
        Start = new FlowDateTimePeriodLimit(DateTimeInterval.Month,0),
        End = new FlowDateTimePeriodLimit(DateTimeInterval.Day,1)
    },
    new DateTimePeriod
    { Name = "Jul-18-2018 - Jan-18-2019",
        Start = new FixedDateTimePeriodLimit(new DateTime(2018, 7, 18)),
        End = new FixedDateTimePeriodLimit(new DateTime(2019, 1, 18)) }
    );
// Specify the period selected when the control is initialized.
rangeFilter.DefaultDateTimePeriodName = "Year To Date";
See Also