Skip to main content
Row

PivotCalculatedItemCollection.RemoveAt(Int32) Method

Removes the calculated item at the specified index from the collection.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v23.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

void RemoveAt(
    int index
)

Parameters

Name Type Description
index Int32

A zero-based integer specifying the index of the calculated item to be removed. It should be non-negative and less than the number of elements in the collection.

Remarks

To remove the specified calculated item from the collection, use the PivotCalculatedItemCollection.Remove method. To remove all calculated items from the collection at once, use the PivotCalculatedItemCollection.Clear method.

Example

View Example

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

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

// Access the pivot field by its name in the collection.
PivotField field = pivotTable.Fields["Customer"];

// Add a calculated item to the "Customer" field.
field.CalculatedItems.Add("='Big Foods'*110%", "Big Foods Sales Plan");

//Remove the calculated item by its index from the collection.
field.CalculatedItems.RemoveAt(0);

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