Skip to main content

Dimension.DateTimeGroupInterval Property

Gets or sets the group interval for date-time values.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v25.1.Core.dll

NuGet Package: DevExpress.Dashboard.Core

Declaration

[DefaultValue(DateTimeGroupInterval.Year)]
public DateTimeGroupInterval DateTimeGroupInterval { get; set; }

Property Value

Type Default Description
DateTimeGroupInterval Year

A DateTimeGroupInterval enumeration member that specifies how to group date-time values.

Remarks

Use the DateTimeGroupInterval property to specify how to group date-time values contained in this Dimension. For instance, they can be grouped by years, months, quarters, days of the week, hours, days of the year, and other date-time intervals.

Refer to the following help topic to see which intervals are supported for DateTime, DateOnly, and TimeOnly fields: Grouping Date-Time Values. If a date-time interval is not supported by the field, the dashboard control shows a notification.

If the Dimension does not contain date-time data, the DateTimeGroupInterval property is not in effect.

You can also format date-time values depending on their group interval. For this, use the DataItem.DateTimeFormat property.

For string dimensions, use the following property to set a group interval: TextGroupInterval.

Warning

You cannot use Grouping feature in OLAP mode.

Example

The following code snippet shows how to create the date-time and string dimensions with the specified group intervals.

Dimension orderDateDimension = new Dimension("Order Date", DateTimeGroupInterval.MonthYear);
Dimension categoryDimension = new Dimension("CategoryName", TextGroupInterval.Alphabetical);
See Also