Skip to main content
Row

PivotTableCollection.Remove(PivotTable) Method

Removes the specified pivot table from the collection.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

void Remove(
    PivotTable table
)

Parameters

Name Type Description
table PivotTable

A PivotTable object to be removed from the collection.

Remarks

Note that calling the Remove method also disposes an element removed from the collection.

To remove a pivot table at the specified index in the collection, use the PivotTableCollection.RemoveAt method. To remove all pivot tables from the collection at once, use the PivotTableCollection.Clear method.

To add a new pivot table to the collection, use the PivotTableCollection.Add method.

Example

View Example

Worksheet worksheet = workbook.Worksheets["Report1"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Access the pivot table by its name in the collection.
PivotTable pivotTable = worksheet.PivotTables["PivotTable1"];
// Remove the pivot table from the collection.
worksheet.PivotTables.Remove(pivotTable);

The following code snippets (auto-collected from DevExpress Examples) contain references to the Remove(PivotTable) 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.

See Also