Back to Devexpress

DxPivotTableField.AreaIndex Property

blazor-devexpress-dot-blazor-dot-pivottable-dot-dxpivottablefield-af1c8b8f.md

latest3.7 KB
Original Source

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.2.dll

NuGet Package : DevExpress.Blazor.PivotTable

Declaration

csharp
[Parameter]
public int AreaIndex { get; set; }

Property Value

TypeDescription
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 AreaField headers allow users to re-arrange fields and sort or filter data. Unique values from corresponding fields are displayed as row headers.Columns AreaField headers allow users to re-arrange fields and sort or filter data. Unique values from corresponding fields are displayed as column headers.Data AreaField 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 AreaFilter 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 additional 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:

razor
<DxPivotTable Data="SalesData">
    <Fields>
        <DxPivotTableField Field="@nameof(Sales.SaleInfo.Region)"
                           Area="@PivotTableArea.Row"
                           AreaIndex="0" />
        @*...*@
    </Fields>
</DxPivotTable>

Refer to the DxPivotTableField class description for additional information and an example.

Implements

AreaIndex

See Also

DxPivotTableField Class

DxPivotTableField Members

DevExpress.Blazor.PivotTable Namespace