Back to Devexpress

PivotGridFieldCollection.Add() Method

windowsforms-devexpress-dot-xtrapivotgrid-dot-pivotgridfieldcollection.md

latest2.7 KB
Original Source

PivotGridFieldCollection.Add() Method

Appends a new field to the collection.

Namespace : DevExpress.XtraPivotGrid

Assembly : DevExpress.XtraPivotGrid.v25.2.dll

NuGet Package : DevExpress.Win.PivotGrid

Declaration

csharp
public PivotGridField Add()
vb
Public Function Add As PivotGridField

Returns

TypeDescription
PivotGridField

The PivotGridField object added to the collection.

|

Remarks

This method creates a new PivotGridField object, initializes it with default settings and appends it to the collection.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Add() 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.

winforms-pivot-grid-display-kpi-graphics/CS/WindowsFormsApp_RegularDataSourceKPI/Form1.cs#L14

csharp
// Creates a new "Status" field to show KPI values.
PivotGridField KPIField = pivotGridControl1.Fields.Add();
KPIField.Area = PivotArea.DataArea;

winforms-pivot-grid-display-kpi-graphics/VB/WindowsFormsApp_RegularDataSourceKPI/Form1.vb#L18

vb
' Creates a new "Status" field to show KPI values.
Dim KPIField As PivotGridField = pivotGridControl1.Fields.Add()
KPIField.Area = PivotArea.DataArea

See Also

PivotGridFieldCollection Class

PivotGridFieldCollection Members

DevExpress.XtraPivotGrid Namespace