aspnet-devexpress-dot-web-dot-aspxpivotgrid-dot-aspxpivotgrid-0b30fd35.md
Provides access to a pivot grid’s field collection.
Namespace : DevExpress.Web.ASPxPivotGrid
Assembly : DevExpress.Web.ASPxPivotGrid.v25.2.dll
NuGet Package : DevExpress.Web
public PivotGridFieldCollection Fields { get; }
Public ReadOnly Property Fields As PivotGridFieldCollection
| Type | Default | Description |
|---|---|---|
| PivotGridFieldCollection | *null* |
A collection of the PivotGridField objects that are the Pivot Grid fields.
|
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.
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
PivotGridField SourceDataField {
get { return pivotGrid.Fields[SourceDataFieldID]; }
}
web-forms-pivot-grid-split-field-value-cells/CS/ASPxPivotGrid_SplittingCells/Data.cs#L28
pivot.Fields.Add(Quantity, PivotArea.DataArea);
foreach (PivotGridField field in pivot.Fields) {
field.AllowedAreas = GetAllowedArea(field.Area);
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
if(!IsPostBack && !IsCallback) {
PivotGridField fieldProductName = ASPxPivotGridOld.Fields["fieldProductName"];
ASPxPivotGridOld.BeginUpdate();
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
Get
Return pivotGrid.Fields(SourceDataFieldID)
End Get
web-forms-pivot-grid-split-field-value-cells/VB/ASPxPivotGrid_SplittingCells/Data.vb#L40
pivot.Fields.Add(Quantity, PivotArea.DataArea)
For Each field As PivotGridField In pivot.Fields
field.AllowedAreas = GetAllowedArea(field.Area)
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
If (Not IsPostBack) AndAlso (Not IsCallback) Then
Dim fieldProductName As PivotGridField = ASPxPivotGridOld.Fields("fieldProductName")
ASPxPivotGridOld.BeginUpdate()
See Also