Back to Devexpress

PivotGridFieldBase.Area Property

corelibraries-devexpress-dot-xtrapivotgrid-dot-pivotgridfieldbase-e8eb62bd.md

latest9.2 KB
Original Source

PivotGridFieldBase.Area Property

Gets or sets the area in which the field is displayed.

Namespace : DevExpress.XtraPivotGrid

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

NuGet Packages : DevExpress.PivotGrid.Core, DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(PivotArea.FilterArea)]
public PivotArea Area { get; set; }
vb
<DefaultValue(PivotArea.FilterArea)>
Public Property Area As PivotArea

Property Value

TypeDefaultDescription
PivotAreaFilterArea

A PivotArea value that specifies the area in which the field is displayed.

|

Available values:

NameDescription
RowArea

Corresponds to the Row Header Area.

| | ColumnArea |

Corresponds to the Column Header Area.

| | FilterArea |

Corresponds to the Filter Header Area.

| | DataArea |

Corresponds to the Data Header Area.

|

Remarks

You can place a field in the following areas: Filter Header Area, Column Header Area, Row Header Area, and Data Header Area. The Area property specifies the area in which the field is displayed. To get the field’s position among the other fields within the same area use the AreaIndex property. You can use the AllowedAreas property to specify the areas within which the field can be positioned.

Dragging a field from one area to another automatically changes the Area property’s value and vice versa.

Multiple fields can be combined into a group with the PivotGridControl.Groups property. These fields cannot be separated and are always dragged together. To move a group to a specific area or to a new position within the current area, use the Area and AreaIndex properties of the first field in the group. Modifying the Area and AreaIndex properties for the second and subsequent fields in the group is ignored.

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

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.

web-forms-pivot-grid-bind-to-sql-data-source/CS/ASPxPivotGrid_RuntimeDataBinding/Default.aspx.cs#L37

csharp
// Locates the Pivot Grid fields in appropriate areas.
ASPxPivotGrid1.Fields["CategoryName"].Area = PivotArea.RowArea;
ASPxPivotGrid1.Fields["ProductName"].Area = PivotArea.RowArea;

winforms-pivot-grid-custom-group-intervals/CS/CustomGroupIntervals/Form1.cs#L16

csharp
PivotGridField pivotGridFieldCountry = new PivotGridField();
pivotGridFieldCountry.Area = PivotArea.ColumnArea;
DataSourceColumnBinding country = new DataSourceColumnBinding("Country");

winforms-pivot-grid-connect-to-an-olap-datasource/CS/WinOlapRetrieveFieldsExample/Form1.cs#L32

csharp
pivotGridControl1.BeginUpdate();
pivotGridControl1.Fields["[Customer].[Country].[Country]"].Area = PivotArea.RowArea;
pivotGridControl1.Fields["[Customer].[Country].[Country]"].Visible = true;

winforms-pivotgrid--display-the-difference-of-income-and-outlay-in-totals/CS/PivotGridCustomSummaryExample/CustomSummaryHelper.cs#L23

csharp
{
    if (!groupField.Visible || groupField.Area == PivotArea.FilterArea || groupField.Area == PivotArea.DataArea)
        return true;

winforms-pivot-grid-draw-a-custom-element-on-mouse-hover/CS/WindowsApplication73/Form1.cs#L25

csharp
pivotGridControl1.RetrieveFields();
pivotGridControl1.Fields["Order"].Area = PivotArea.RowArea;
pivotGridControl1.Fields["Type"].Area = PivotArea.ColumnArea;

web-forms-pivot-grid-bind-to-sql-data-source/VB/ASPxPivotGrid_RuntimeDataBinding/Default.aspx.vb#L32

vb
' Locates the Pivot Grid fields in appropriate areas.
ASPxPivotGrid1.Fields("CategoryName").Area = PivotArea.RowArea
ASPxPivotGrid1.Fields("ProductName").Area = PivotArea.RowArea

winforms-pivot-grid-custom-group-intervals/VB/CustomGroupIntervals/Form1.vb#L18

vb
Dim pivotGridFieldCountry As PivotGridField = New PivotGridField()
pivotGridFieldCountry.Area = PivotArea.ColumnArea
Dim country As DataSourceColumnBinding = New DataSourceColumnBinding("Country")

winforms-pivot-grid-connect-to-an-olap-datasource/VB/WinOlapRetrieveFieldsExample/Form1.vb#L33

vb
pivotGridControl1.BeginUpdate()
pivotGridControl1.Fields("[Customer].[Country].[Country]").Area = PivotArea.RowArea
pivotGridControl1.Fields("[Customer].[Country].[Country]").Visible = True

winforms-pivotgrid--display-the-difference-of-income-and-outlay-in-totals/VB/PivotGridCustomSummaryExample/CustomSummaryHelper.vb#L23

vb
Public Shared Function ShouldCalculateCustomValue(ByVal groupField As PivotGridField, ByVal e As PivotGridCustomSummaryEventArgs) As Boolean
    If Not groupField.Visible OrElse groupField.Area = PivotArea.FilterArea OrElse groupField.Area = PivotArea.DataArea Then
        Return True

winforms-pivot-grid-draw-a-custom-element-on-mouse-hover/VB/WindowsApplication73/Form1.vb#L22

vb
pivotGridControl1.RetrieveFields()
pivotGridControl1.Fields("Order").Area = PivotArea.RowArea
pivotGridControl1.Fields("Type").Area = PivotArea.ColumnArea

See Also

AllowedAreas

AreaIndex

SetAreaPosition(PivotArea, Int32)

PivotGridFieldBase Class

PivotGridFieldBase Members

DevExpress.XtraPivotGrid Namespace