Skip to main content
All docs
V24.2

DxPivotTable.Reload() Method

Reloads Pivot Table data.

Namespace: DevExpress.Blazor.PivotTable

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

NuGet Package: DevExpress.Blazor.PivotTable

Declaration

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.

<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