Back to Devexpress

PivotGridFieldCollection.Add() Method

wpf-devexpress-dot-xpf-dot-pivotgrid-dot-pivotgridfieldcollection.md

latest4.0 KB
Original Source

PivotGridFieldCollection.Add() Method

Appends a new field to the collection.

Namespace : DevExpress.Xpf.PivotGrid

Assembly : DevExpress.Xpf.PivotGrid.v25.2.dll

NuGet Package : DevExpress.Wpf.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 snippets (auto-collected from DevExpress Examples) contain references 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.

wpf-pivot-grid-bind-to-an-mdb-database/CS/HowToBindToMDB/MainWindow.xaml.cs#L45

csharp
private void AddField(string caption, FieldArea area, string columnName, int index) {
    PivotGridField field = pivotGridControl1.Fields.Add();
    field.Caption = caption;

wpf-pivot-grid-bind-to-an-olap-cube-net6/CS/HowToBindOLAP/MainWindow.xaml.cs#L46

csharp
private PivotGridField AddField(string caption, FieldArea area, string fieldName, int index) {
    PivotGridField field = pivotGridControl1.Fields.Add();
    field.Caption = caption;

wpf-pivotgrid-hide-column-totals/CS/HowToBindToMDB/MainWindow.xaml.cs#L35

csharp
private void AddField(string caption,FieldArea area,string columnName,int index) {
    PivotGridField field = pivotGridControl1.Fields.Add();
    field.Caption = caption;

wpf-pivot-grid-bind-to-an-mdb-database/VB/HowToBindToMDB/MainWindow.xaml.vb#L40

vb
Private Sub AddField(ByVal caption As String, ByVal area As FieldArea, ByVal columnName As String, ByVal index As Integer)
    Dim field As PivotGridField = pivotGridControl1.Fields.Add()
    field.Caption = caption

wpf-pivot-grid-bind-to-an-olap-cube-net6/VB/HowToBindOLAP/MainWindow.xaml.vb#L41

vb
Private Function AddField(ByVal caption As String, ByVal area As FieldArea, ByVal fieldName As String, ByVal index As Integer) As PivotGridField
    Dim field As PivotGridField = pivotGridControl1.Fields.Add()
    field.Caption = caption

See Also

PivotGridFieldCollection Class

PivotGridFieldCollection Members

DevExpress.Xpf.PivotGrid Namespace