Skip to main content
Row

PivotCalculatedFieldCollection.RemoveAt(Int32) Method

Removes the calculated field 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 field to be removed. It should be non-negative and less than the number of elements in the collection.

Remarks

To remove the specified calculated field from the collection, use the PivotCalculatedFieldCollection.Remove method. To remove all calculated fields from the collection at once, use the PivotCalculatedFieldCollection.Clear 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"];
// Create a calculated field based on data in the "Sales" field.
pivotTable.CalculatedFields.Add("=Sales*10%", "Sales Tax");
// Access the calculated field by its name in the collection.
PivotField field = pivotTable.CalculatedFields["Sales Tax"];
// Add the calculated field to the data area. 
PivotDataField dataField = pivotTable.DataFields.Add(field);
//Remove the calculated field.
pivotTable.CalculatedFields.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