Skip to main content
Row

PivotFieldReferenceCollection.Remove(PivotFieldReference) Method

Removes the specified row or column field from the collection.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

void Remove(
    PivotFieldReference fieldReference
)

Parameters

Name Type Description
fieldReference PivotFieldReference

A PivotFieldReference object that specifies the row or column field to be removed from the collection.

Remarks

Use the Remove method to remove the specified row field from the PivotTable.RowFields collection (as shown in the example below), or the specified column field from the PivotTable.ColumnFields collection.

View Example

Dim worksheet As Worksheet = workbook.Worksheets("Report1")
workbook.Worksheets.ActiveWorksheet = worksheet

' Access the pivot table by its name in the collection.
Dim pivotTable As PivotTable = worksheet.PivotTables("PivotTable1")

' Remove the "Product" field from the row axis area.
pivotTable.RowFields.Remove(pivotTable.RowFields("Product"))

To remove a row (or column) field from the PivotTable.RowFields (or PivotTable.ColumnFields) collection by its index, use the PivotFieldReferenceCollection.RemoveAt method. To remove all fields from the collection of row or column fields, use the PivotFieldReferenceCollection.Clear method.

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