Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxPivotGridField.GroupInterval Property

Specifies how the values of the current column or row field are combined into groups.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(PivotGridGroupInterval.NotSet)]
[Parameter]
public PivotGridGroupInterval GroupInterval { get; set; }

#Property Value

Type Default Description
PivotGridGroupInterval NotSet

A PivotGridGroupInterval enumeration values.

Available values:

Name Description
NotSet

Unique field values are displayed as is.

Year

This option is in effect only for fields that store date/time values.
Field values are grouped by the year. Examples: 2003, 2004, 2005.

Quarter

This option is in effect only for fields that store date/time values.
Field values are grouped by the quarterly intervals of the year. Each quarter includes three months. Examples: 1, 2, 3, and 4.

Month

This option is in effect only for fields that store date/time values.
Field values are grouped by the month part. Examples: January, February, March (the actual names of the months are determined by the current culture).

#Remarks

The control doesn’t group the values of column and row fields by default and displays all their unique values. You can use the GroupInterval property to combine values of these fields into groups.

For instance, you can set the GroupInterval property to Year for a field that displays date/time values. The field combines values belonging to the same year and displays them grouped by year.

Use the HeaderTemplate property to specify the template used to display the field’s header.

The following code snippet sets a group interval:

razor
<DxPivotGrid Data="@GridData">
    <DxPivotGridField Field="@nameof(SaleInfo.Date)" GroupInterval="PivotGridGroupInterval.Year" Area="PivotGridFieldArea.Column" Caption="Year"></DxPivotGridField>
    <DxPivotGridField Field="@nameof(SaleInfo.Date)" GroupInterval="PivotGridGroupInterval.Quarter" Area="PivotGridFieldArea.Column" Caption="Quarter">
        <HeaderTemplate>@string.Format("Q{0}", context)</HeaderTemplate>
    </DxPivotGridField>
</DxPivotGrid>

You can bind multiple DxPivotGridField objects to the same field in the underlying data source. These fields can have different values for their GroupInterval property. In this case, each field groups the same data in its own way.

See Also