Skip to main content
Row

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PivotFieldReferenceCollection.InsertValuesReference(Int32) Method

Inserts the virtual “Values” field into the collection at the specified index.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

#Declaration

PivotFieldReference InsertValuesReference(
    int index
)

#Parameters

Name Type Description
index Int32

A zero-based integer which specifies the position at which the “Values” field should be inserted. If it is negative or exceeds the number of elements within the collection, an exception is raised.

#Returns

Type Description
PivotFieldReference

A PivotFieldReference object which represents a reference to the inserted “Values” field.

#Remarks

Use the InsertValuesReference method to add the virtual “Values” field to the PivotTable.ColumnFields or PivotTable.RowFields collection at the specified position. The “Values” field automatically appears in a pivot table with more than one field in the data area and is used to specify the orientation of multiple data fields in the report. By default, the “Values” field is added to the end of the PivotTable.ColumnFields collection, so that multiple data fields are displayed across the columns, as shown in the image below.

PivotTable_ValuesField

You can also change the “Values” field’s position within the column or row area using the MoveDown, MoveUp, MoveToBeginning or MoveToEnd method of the PivotFieldReference object representing a reference to the “Values” field in the report. To determine whether the specified PivotFieldReference is the “Values” field, use the PivotFieldReference.IsValuesReference property.

See Also