Back to Devexpress

ASPxPivotGrid.Fields Property

aspnet-devexpress-dot-web-dot-aspxpivotgrid-dot-aspxpivotgrid-0b30fd35.md

latest6.3 KB
Original Source

ASPxPivotGrid.Fields Property

Provides access to a pivot grid’s field collection.

Namespace : DevExpress.Web.ASPxPivotGrid

Assembly : DevExpress.Web.ASPxPivotGrid.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public PivotGridFieldCollection Fields { get; }
vb
Public ReadOnly Property Fields As PivotGridFieldCollection

Property Value

TypeDefaultDescription
PivotGridFieldCollection*null*

A collection of the PivotGridField objects that are the Pivot Grid fields.

|

Remarks

This property stores all the fields contained in the ASPxPivotGrid control. It allows you to add and delete fields with appropriate methods. You can access individual fields with indexed notation.

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

aspxpivotgrid-field-calculation-bindings/CS/AspNetWebFormsPivotFieldCalculationBindings/Default.aspx.cs#L9

csharp
if(!IsPostBack && !IsCallback) {
    PivotGridField fieldProductName = ASPxPivotGrid1.Fields["fieldProductName"];
    PivotGridField fieldCountry = ASPxPivotGrid1.Fields["fieldCountry"];

web-forms-pivot-grid-change-summary-display-mode/CS/SummaryDisplayMode/Default.aspx.cs#L27

csharp
PivotGridField SourceDataField {
    get { return pivotGrid.Fields[SourceDataFieldID]; }
}

web-forms-pivot-grid-split-field-value-cells/CS/ASPxPivotGrid_SplittingCells/Data.cs#L28

csharp
pivot.Fields.Add(Quantity, PivotArea.DataArea);
foreach (PivotGridField field in pivot.Fields) {
    field.AllowedAreas = GetAllowedArea(field.Area);

web-forms-pivot-grid-hide-particular-rows-and-columns/CS/ASPxPivotGrid_HidingColumnsAndRows/Data.cs#L29

csharp
pivot.Fields.AddDataSourceColumn(Remains, PivotArea.DataArea);
foreach (PivotGridField field in pivot.Fields) {
    field.AllowedAreas = GetAllowedArea(field.Area);

aspxpivotgrid-layout-upgrade-event/CS/ASPxPivotGridLayoutUpgradeEvent/Default.aspx.cs#L10

csharp
if(!IsPostBack && !IsCallback) {
    PivotGridField fieldProductName = ASPxPivotGridOld.Fields["fieldProductName"];
    ASPxPivotGridOld.BeginUpdate();

aspxpivotgrid-field-calculation-bindings/VB/AspNetWebFormsPivotFieldCalculationBindings/Default.aspx.vb#L11

vb
If (Not IsPostBack) AndAlso (Not IsCallback) Then
    Dim fieldProductName As PivotGridField = ASPxPivotGrid1.Fields("fieldProductName")
    Dim fieldCountry As PivotGridField = ASPxPivotGrid1.Fields("fieldCountry")

web-forms-pivot-grid-change-summary-display-mode/VB/SummaryDisplayMode/Default.aspx.vb#L44

vb
Get
    Return pivotGrid.Fields(SourceDataFieldID)
End Get

web-forms-pivot-grid-split-field-value-cells/VB/ASPxPivotGrid_SplittingCells/Data.vb#L40

vb
pivot.Fields.Add(Quantity, PivotArea.DataArea)
For Each field As PivotGridField In pivot.Fields
    field.AllowedAreas = GetAllowedArea(field.Area)

web-forms-pivot-grid-hide-particular-rows-and-columns/VB/ASPxPivotGrid_HidingColumnsAndRows/Default.aspx.vb#L38

vb
Return
If e.Field Is pivotGrid.Fields(Month) Then
    e.DisplayText = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(CInt(e.Value))

aspxpivotgrid-layout-upgrade-event/VB/ASPxPivotGridLayoutUpgradeEvent/Default.aspx.vb#L11

vb
If (Not IsPostBack) AndAlso (Not IsCallback) Then
    Dim fieldProductName As PivotGridField = ASPxPivotGridOld.Fields("fieldProductName")
    ASPxPivotGridOld.BeginUpdate()

See Also

ASPxPivotGrid Class

ASPxPivotGrid Members

DevExpress.Web.ASPxPivotGrid Namespace