Skip to main content
All docs
V25.1
  • DxPivotTable.ExpandAllRows() Method

    Expands all rows in the Pivot Table component.

    Namespace: DevExpress.Blazor.PivotTable

    Assembly: DevExpress.Blazor.PivotTable.v25.1.dll

    NuGet Package: DevExpress.Blazor.PivotTable

    Declaration

    public void ExpandAllRows()

    Remarks

    Call the ExpandAllRows or CollapseAllRows method to expand or collapse all rows in the Pivot Table component.

    The following code adds two buttons: Collapse All Rows and Expand All Rows.

    @rendermode InteractiveServer
    
    <DxButton Text="Collapse All Rows" Click="OnCollapseClick" />
    <DxButton Text="Expand All Rows" Click="OnExpandClick" />
    <p/>
    
    <DxPivotTable Data="SalesData" style="height:460px" @ref=MyPivotTable >
        <Fields>
            <DxPivotTableField Field="@nameof(Sales.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" />
            <DxPivotTableField Field="@nameof(Sales.SaleInfo.City)"
                               Area="@PivotTableArea.Filter"/>
        </Fields>
    </DxPivotTable>
    
    @code {
        IPivotTable MyPivotTable { get; set; }
        PivotTablePersistentLayout Layout { get; set; }
        IEnumerable<Sales.SaleInfo> SalesData;
        protected override async Task OnInitializedAsync() {
            SalesData = await Sales.GetSalesAsync();
        }
    
        void OnCollapseClick() {
            MyPivotTable.CollapseAllRows();
        }
    
        void OnExpandClick() {
            MyPivotTable.ExpandAllRows();
        }
    }
    

    Pivot Table - Expand Collapse Rows

    Implements

    See Also