Skip to main content
All docs
V24.2

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

DxPivotTable.Reload() Method

Reloads Pivot Table data.

Namespace: DevExpress.Blazor.PivotTable

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

NuGet Package: DevExpress.Blazor.PivotTable

#Declaration

C#
public void Reload()

#Remarks

Call the Reload method after the Pivot Table’s bound data source is changed. The method gets updated data from the source and applies changes to the Pivot Table.

The following code adds two buttons that allow you to add a new item to the data source and reload the Pivot Table data.

Razor
<button @onclick="AddNewItem">Add a new item to the data source</button>
<button @onclick="ReloadPivotTable">Reload</button>

<DxPivotTable Data="@Data" @ref="pivotTable">
    <Fields>
        <DxPivotTableField Field="Region" 
                           Area="PivotTableArea.Row" />
        <DxPivotTableField Field="Country" 
                           Area="PivotTableArea.Row" />
        <DxPivotTableField Field="Date" 
                           Area="PivotTableArea.Column" 
                           GroupInterval="PivotTableGroupIntervalDateWeekOfMonth" 
                           Caption="WeekOfMonth" />
        <DxPivotTableField Field="OrderId" 
                           Area="PivotTableArea.Data" 
                           SummaryType="PivotTableSummaryTypeCount" />
    </Fields>
</DxPivotTable>

@code {
    List<SaleInfo> Data;
    IPivotTable pivotTable;

    protected override void OnInitialized() {
        Data = SaleInfo.GetAsia().ToList();
    }

    void AddNewItem() { 
        Data.Add(new SaleInfo() { Region = "Asia", Country = "Japan", Date = new DateTime(2020, 1, 1), OrderId = 100 });
    }

    void ReloadPivotTable() {
        pivotTable.Reload();
    }
}

#Implements

See Also