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
public class DateTimePeriod :
IXmlSerializableElement,
IDateTimePeriodLimitOwner,
INameContainer,
INamedItem,
ISupportPrefix,
IDateTimePeriod
Public Class DateTimePeriod
Implements IXmlSerializableElement,
IDateTimePeriodLimitOwner,
INameContainer,
INamedItem,
ISupportPrefix,
IDateTimePeriod
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 you do not specify DateTimePeriod.Start/DateTimePeriod.End, the selection will begin from the start/end of the visible range.
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.
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);
Dim rangeFilter As New RangeFilterDashboardItem()
' ...
Dim startDate As New FixedDateTimePeriodLimit(New System.DateTime(2015, 1, 1))
Dim endDate As New FlowDateTimePeriodLimit(DateTimeInterval.Month, -1)
Dim customPeriod As New DateTimePeriod("Custom period", startDate, endDate)
rangeFilter.DateTimePeriods.Add(customPeriod)