DxPivotTable.RowTotalsPosition Property
Specifies the position of row totals.
Namespace: DevExpress.Blazor.PivotTable
Assembly: DevExpress.Blazor.PivotTable.v24.2.dll
NuGet Package: DevExpress.Blazor.PivotTable
Declaration
[DefaultValue(PivotTableRowTotalsPosition.After)]
[Parameter]
public PivotTableRowTotalsPosition RowTotalsPosition { get; set; }
Property Value
Type | Default | Description |
---|---|---|
PivotTableRowTotalsPosition | After | A PivotTableRowTotalsPosition enumeration value. |
Available values:
Name | Description |
---|---|
Before | Row totals are displayed before rows with field values. |
After | Row totals are displayed after rows with field values. |
Remarks
The DevExpress Blazor Pivot Table calculates totals for its data and displays them as separate columns and rows. There are four types of totals:
- Row/column totals display sub-totals calculated for outer row/column fields.
- Row/column grand totals display overall totals calculated against all rows/columns.
You can use the following properties to set the position of row/column totals relative to rows/columns:
RowTotalsPosition
- ColumnTotalsPosition
The following code changes the position of row and column totals to Before
:
@rendermode InteractiveServer
<DxPivotTable Data="SalesData"
RowTotalsPosition="PivotTableRowTotalsPosition.Before"
ColumnTotalsPosition="PivotTableColumnTotalsPosition.Before">
<Fields>
<DxPivotTableField Field="@nameof(SaleInfo.Region)"
Area="@PivotTableArea.Row"
AreaIndex="0" />
<DxPivotTableField Field="@nameof(Sales.SaleInfo.Country)"
Area="@PivotTableArea.Row"
SortOrder="@PivotTableSortOrder.Descending"
AreaIndex="1" />
<DxPivotTableField Field="@nameof(Sales.SaleInfo.Date)"
GroupInterval="@PivotTableGroupInterval.DateYear"
Area="@PivotTableArea.Column"
AreaIndex="0"
Caption="Year" />
<DxPivotTableField Field="@nameof(Sales.SaleInfo.Date)"
GroupInterval="@PivotTableGroupInterval.DateQuarter"
Area="@PivotTableArea.Column"
AreaIndex="1"
Caption="Quarter" />
<DxPivotTableField Field="@nameof(Sales.SaleInfo.Amount)"
SortOrder="@PivotTableSortOrder.Ascending"
Area="@PivotTableArea.Data"
SummaryType="@PivotTableSummaryType.Sum" />
</Fields>
</DxPivotTable>
@code {
IEnumerable<SaleInfo> SalesData;
protected override async Task OnInitializedAsync() {
SalesData = await Sales.GetSalesAsync();
}
}
You can also hide different totals. Use the following properties: