corelibraries-devexpress-dot-xtrapivotgrid-dot-pivotgridfieldbase-a8ee6eec.md
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
[DefaultValue(PivotGridAllowedAreas.All)]
public PivotGridAllowedAreas AllowedAreas { get; set; }
<DefaultValue(PivotGridAllowedAreas.All)>
Public Property AllowedAreas As PivotGridAllowedAreas
| Type | Default | Description |
|---|---|---|
| PivotGridAllowedAreas | All |
A PivotGridAllowedAreas value that specifies which areas the field can be positioned in.
|
Available values:
| Name | Description |
|---|---|
| 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.
|
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
// 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
foreach (PivotGridField field in pivot.Fields) {
field.AllowedAreas = GetAllowedArea(field.Area);
}
winforms-pivot-split-field-value-cells/CS/Data.cs#L28
foreach (PivotGridField field in pivot.Fields) {
field.AllowedAreas = GetAllowedArea(field.Area);
}
winforms-pivot-grid-display-kpi-graphics/VB/WindowsFormsApp_RegularDataSourceKPI/Form1.vb#L24
' 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
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
For Each field As PivotGridField In pivot.Fields
field.AllowedAreas = GetAllowedArea(field.Area)
Next field
See Also