Back to Devexpress

PivotGridControl.RefreshData() Method

windowsforms-devexpress-dot-xtrapivotgrid-dot-pivotgridcontrol-9363eae8.md

latest6.4 KB
Original Source

PivotGridControl.RefreshData() Method

Reloads data from the control’s data source and recalculates summaries.

Namespace : DevExpress.XtraPivotGrid

Assembly : DevExpress.XtraPivotGrid.v25.2.dll

NuGet Package : DevExpress.Win.PivotGrid

Declaration

csharp
public void RefreshData()
vb
Public Sub RefreshData

Remarks

This method reloads data from the control’s data source specified by the PivotGridControl.DataSource and PivotGridControl.DataMember properties. This causes the summaries to be recalculated against the data fields.

When the control’s data source is modified, the Pivot Grid Control does not automatically reload the records. In this case, the RefreshData method can be called to force the data to reload.

To reload data asynchronously, use the PivotGridControl.RefreshDataAsync method.

The following code snippets (auto-collected from DevExpress Examples) contain references to the RefreshData() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-highlight-pivot-cells-that-correspond-to-a-series-point-on-hover/CS/WindowsApplication53/Form1.cs#L14

csharp
PopulateTable();
pivotGridControl1.RefreshData();
pivotGridControl1.BestFit();

winforms-pivot-change-the-field-value-header-appearance-backcolor/CS/WindowsApplication53/Form1.cs#L13

csharp
PopulateTable();
    pivotGridControl1.RefreshData();
}

winforms-pivot-customize-appearance-of-the-even-odd-groups-of-cells/CS/WindowsApplication53/Form1.cs#L17

csharp
PopulateTable();
pivotGridControl1.RefreshData();
pivotGridControl1.BestFit();

winforms-pivot-chart-integration-hide-unnecessary-series-from-the-chart/CS/WindowsApplication53/Form1.cs#L12

csharp
PopulateTable();
pivotGridControl1.RefreshData();
pivotGridControl1.BestFit();

pivot-grid-winforms-provide-custom-date-time-group-intervals-and-preserve-correct-sort-order/CS/WindowsApplication21/Form1.cs#L28

csharp
FillDataSource(DateTime.Today.AddYears(-2), DateTime.Today.AddYears(2));
pivotGridControl1.RefreshData();
pivotGridControl1.BestFit();

winforms-highlight-pivot-cells-that-correspond-to-a-series-point-on-hover/VB/WindowsApplication53/Form1.vb#L18

vb
PopulateTable()
pivotGridControl1.RefreshData()
pivotGridControl1.BestFit()

winforms-pivot-change-the-field-value-header-appearance-backcolor/VB/WindowsApplication53/Form1.vb#L15

vb
PopulateTable()
    pivotGridControl1.RefreshData()
End Sub

winforms-pivot-customize-appearance-of-the-even-odd-groups-of-cells/VB/WindowsApplication53/Form1.vb#L20

vb
PopulateTable()
pivotGridControl1.RefreshData()
pivotGridControl1.BestFit()

winforms-pivot-chart-integration-hide-unnecessary-series-from-the-chart/VB/WindowsApplication53/Form1.vb#L16

vb
PopulateTable()
pivotGridControl1.RefreshData()
pivotGridControl1.BestFit()

pivot-grid-winforms-provide-custom-date-time-group-intervals-and-preserve-correct-sort-order/VB/WindowsApplication21/Form1.vb#L32

vb
FillDataSource(Date.Today.AddYears(-2), Date.Today.AddYears(2))
pivotGridControl1.RefreshData()
pivotGridControl1.BestFit()

See Also

LayoutChanged()

PivotGridControl Class

PivotGridControl Members

DevExpress.XtraPivotGrid Namespace