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.1.dll
NuGet Package: DevExpress.Blazor
Declaration
[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. |
Quarter | This option is in effect only for fields that store date/time values. |
Month | This option is in effect only for fields that store date/time values. |
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:
<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.