PivotPageFieldCollection.Insert(Int32, PivotField) Method
Inserts a page field into the PivotPageFieldCollection collection at the specified index.
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v24.2.Core.dll
NuGet Package: DevExpress.Spreadsheet.Core
Declaration
Parameters
Name | Type | Description |
---|---|---|
index | Int32 | A zero-based integer which specifies the position at which the field should be inserted. |
field | PivotField | A PivotField object representing the field to insert into the collection. |
Returns
Type | Description |
---|---|
PivotPageField | A PivotPageField object which represents the inserted page field. |
Remarks
Use the Insert method to add a new field to the PivotTable’s report filter area at the specified position.
If the index parameter is negative or exceeds the number of elements within the collection, a ArgumentOutOfRangeException exception is raised. When inserting a new field, the page fields that follow the insertion point move down to accommodate the new field. The indexes of the moved fields are updated as well.
To add a new page field to the end of a collection, use the PivotPageFieldCollection.Add method. To remove a page field from the collection, use the PivotPageFieldCollection.Remove or PivotPageFieldCollection.RemoveAt method. You can also use the PivotPageFieldCollection.Clear method to remove all fields from the PivotTable’s report filter area.