DxPivotTableField.AreaIndex Property
Specifies the field’s index among other fields displayed within the same area.
Namespace: DevExpress.Blazor.PivotTable
Assembly: DevExpress.Blazor.PivotTable.v25.1.dll
NuGet Package: DevExpress.Blazor.PivotTable
Declaration
[Parameter]
public int AreaIndex { get; set; }
Property Value
Type | Description |
---|---|
Int32 | The field’s index (zero-based) among other fields. |
Remarks
The Blazor Pivot Table consists of four areas where you or your user can place database fields.
- Rows Area
- Field headers allow users to re-arrange fields and sort or filter data. Unique values from corresponding fields are displayed as row headers.
- Columns Area
- Field headers allow users to re-arrange fields and sort or filter data. Unique values from corresponding fields are displayed as column headers.
- Data Area
- Field headers allow users to re-arrange fields and sort or filter data. Data cells display information from these fields. Each cell value is a summary calculated against the dataset (filtered by corresponding row/column values).
- Filter Area
- Filter fields do not affect data layout. Use field headers to filter data against fields that are not used in row, column, or data areas. Refer to Filter Data for more information.
Use the AreaIndex
property to specify the field’s index among other fields displayed within the same area. If the AreaIndex
property is set to a negative value (for example, -1
), the field is hidden.
If you do not specify the AreaIndex
for certain fields, the Pivot Table renders the fields with a defined AreaIndex
first.
When a user drags a field in the Pivot Table or Field List, the Pivot Table component updates the field’s AreaIndex
property and reorders fields. You can also call the Pivot Table’s SetFieldPosition(String, PivotTableArea, Int32) method to set a field position. Handle a field’s AreaIndexChanged or FieldPositionChanging events to respond to field position changes.
The following code adds the Region field to the Rows area and sets the field’s index to 0
:
<DxPivotTable Data="SalesData">
<Fields>
<DxPivotTableField Field="@nameof(Sales.SaleInfo.Region)"
Area="@PivotTableArea.Row"
AreaIndex="0" />
@*...*@
</Fields>
</DxPivotTable>
Refer to the DxPivotTableField class description for more information and an example.