Skip to main content
All docs
V24.2

DxPivotTable.ColumnTotalsPosition Property

Specifies the position of column totals.

Namespace: DevExpress.Blazor.PivotTable

Assembly: DevExpress.Blazor.PivotTable.v24.2.dll

NuGet Package: DevExpress.Blazor.PivotTable

Declaration

[DefaultValue(PivotTableColumnTotalsPosition.After)]
[Parameter]
public PivotTableColumnTotalsPosition ColumnTotalsPosition { get; set; }

Property Value

Type Default Description
PivotTableColumnTotalsPosition After

A PivotTableColumnTotalsPosition enumeration value.

Available values:

Name Description
Before

Column totals are displayed before columns with field values.

After

Column totals are displayed after columns 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.

Pivot Table Totals

Run Demo: Totals

You can use the following properties to set the position of row/column totals relative to rows/columns:

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();
    }
}

Pivot Table - Totals Position

You can also use the following properties to hide different totals:

See Also