Skip to main content
A newer version of this page is available. .

PivotGridField Class

A field within the PivotGridControl control.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v18.1.dll

Declaration

public class PivotGridField :
    PivotGridFieldBase,
    IPivotGridViewInfoDataOwner,
    ISupportLookAndFeel

Remarks

A PivotGridField object is a field in the Pivot Grid control.

A field can be located in one of following areas:

cdFieldsLocation1

Area Field Type PivotGridFieldBase.Area value
Column Header Area Column Field PivotArea.ColumnArea
Row Header Area Row Field PivotArea.RowArea
Data Area Data Field PivotArea.DataArea
Filter Header Area Filter Field PivotArea.FilterArea

The field’s position within its area is specified by the PivotGridFieldBase.AreaIndex property.

Fields can be bound and unbound. Bound fields get their data from a data source field whose name equals the PivotDataField.Name property value. Data for unbound fields should be supplied manually - by handling the PivotGridControl.CustomUnboundFieldData event.

Tip

To obtain distinct field values which can be used to filter a Pivot Grid’s data, call the PivotGridFieldBase.GetUniqueValues method. See the Filtering Overview topic for more information on Pivot Grid’s data filtering.

Use the following methods to obtain field data:

Method Description
PivotGridFieldBase.GetUniqueValues Obtains an array of distinct field values from the underlying data source. This method is used to fill in field’s Filter Editors.
PivotGridFieldBase.GetAvailableValues Obtains an array of distinct field values contained in the records which are left after applying filters to other fields.
PivotGridFieldBase.GetVisibleValues Obtains a collection of unique field values contained in the records displayed in the Pivot Grid. Thus, these records are left after applying a field’s filter to the field’s available values (values contained in the records which are left after applying filters to other fields).

The following code snippets (auto-collected from DevExpress Examples) contain references to the PivotGridField class.

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