Back to Devexpress

PivotGridFieldBase.AllowedAreas Property

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

latest6.0 KB
Original Source

PivotGridFieldBase.AllowedAreas Property

Gets or sets the areas within which the field can be positioned.

Namespace : DevExpress.XtraPivotGrid

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

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

Declaration

csharp
[DefaultValue(PivotGridAllowedAreas.All)]
public PivotGridAllowedAreas AllowedAreas { get; set; }
vb
<DefaultValue(PivotGridAllowedAreas.All)>
Public Property AllowedAreas As PivotGridAllowedAreas

Property Value

TypeDefaultDescription
PivotGridAllowedAreasAll

A PivotGridAllowedAreas value that specifies which areas the field can be positioned in.

|

Available values:

NameDescription
All

Specifies that a field can be positioned within any area.

| | RowArea |

Specifies that a field can be positioned within the Row Header Area.

| | ColumnArea |

Specifies that a field can be positioned within the Column Header Area.

| | FilterArea |

Specifies that a field can be positioned within the Filter Header Area.

| | DataArea |

Specifies that a field can be positioned within the Data Header Area.

|

Remarks

The AllowedAreas property can be used to prevent the current field from being dragged to a particular area. The PivotGridAllowedAreas type is an enumeration. If a specific flag in the AllowedAreas value is cleared the field cannot be positioned within the corresponding area.

The following code snippets (auto-collected from DevExpress Examples) contain references to the AllowedAreas 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.

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

csharp
// Sets the Data Header Area within which the "Status" Field can be positioned.
KPIField.AllowedAreas = DevExpress.XtraPivotGrid.PivotGridAllowedAreas.DataArea;
// Specifies a graphic set used to indicate KPI values.

winforms-pivot-grid-hide-specific-columns-and-rows/CS/Data.cs#L29

csharp
foreach (PivotGridField field in pivot.Fields) {
    field.AllowedAreas = GetAllowedArea(field.Area);
}

winforms-pivot-split-field-value-cells/CS/Data.cs#L28

csharp
foreach (PivotGridField field in pivot.Fields) {
    field.AllowedAreas = GetAllowedArea(field.Area);
}

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

vb
' Sets the Data Header Area within which the "Status" Field can be positioned.
KPIField.AllowedAreas = PivotGridAllowedAreas.DataArea
' Specifies a graphic set used to indicate KPI values.

winforms-pivot-grid-hide-specific-columns-and-rows/VB/Data.vb#L33

vb
For Each field As PivotGridField In pivot.Fields
    field.AllowedAreas = GetAllowedArea(field.Area)
Next field

winforms-pivot-split-field-value-cells/VB/Data.vb#L32

vb
For Each field As PivotGridField In pivot.Fields
    field.AllowedAreas = GetAllowedArea(field.Area)
Next field

See Also

Area

AreaIndex

IsAreaAllowed(PivotArea)

SetAreaPosition(PivotArea, Int32)

FieldAreaChanging

PivotGridFieldBase Class

PivotGridFieldBase Members

DevExpress.XtraPivotGrid Namespace