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

DateTimePeriod Class

A date-time period that can be used to select a predefined range in the Range Filter using its context menu.

Namespace: DevExpress.DashboardCommon

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

Declaration

public class DateTimePeriod :
    IXmlSerializableElement,
    IDateTimePeriodLimitOwner,
    INameContainer,
    INamedItem,
    ISupportPrefix,
    IDateTimePeriod

Remarks

The RangeFilterDashboardItem class exposes the RangeFilterDashboardItem.DateTimePeriods property providing access to a collection of predefined date-time periods.

To add the required date-time period in code, create the DateTimePeriod class instance and perform the following steps.

If necessary, you can specify the default selected range for the Range Filter. To do this, assign the DateTimePeriod.Name value to the RangeFilterDashboardItem.DefaultDateTimePeriodName property.

Example

This example shows how to create a predefined date-time period for the Range Filter dashboard item.

            RangeFilterDashboardItem rangeFilter = new RangeFilterDashboardItem();
            // ...

            FixedDateTimePeriodLimit startDate = new FixedDateTimePeriodLimit(new System.DateTime(2015, 1, 1));
            FlowDateTimePeriodLimit endDate = new FlowDateTimePeriodLimit(DateTimeInterval.Month, -1);
            DateTimePeriod customPeriod = new DateTimePeriod("Custom period", startDate, endDate);
            rangeFilter.DateTimePeriods.Add(customPeriod); 

Inheritance

Object
DateTimePeriod
See Also