Skip to main content

PivotGridControl.DataFieldUnboundExpressionMode Property

Gets or sets whether unbound expressions for data fields are calculated based on the data source records, or summary values. This is a dependency property.

Namespace: DevExpress.Xpf.PivotGrid

Assembly: DevExpress.Xpf.PivotGrid.v14.2.dll

#Declaration

[XtraSerializablePropertyId(2)]
[XtraSerializableProperty]
public UnboundExpressionMode DataFieldUnboundExpressionMode { get; set; }

#Property Value

Type Description
UnboundExpressionMode

One of the UnboundExpressionMode enumeration members, specifying how the unbound expressions for data fields are calculated.

#Remarks

Unbound expressions can be calculated against summary values, or values stored in the underlying data source.

The image below shows the DXPivotGrid with the drill down form invoked. The 'Price Per Unit' column is unbound, and the expression is specified as [Extended Price] / [Quantity].

pivotgrid_UnboundExpressionMode

If the DataFieldUnboundExpressionMode property is set to UnboundExpressionMode.Default, the unbound expression is calculated against each data source record, and then the resulting values are summarized. In the pivot grid shown above, the 'Price Per Unit' column value in the 'Gravad lax' row will be calculated as follows:

Sum([Extended Price] / [Quantity]) = 20.8 / 1 + 582.4 / 28 + 208 / 10 + 421.2 / 18 + 1248 / 60 + 208 / 8 = 132.6

If the DataFieldUnboundExpressionMode property is set to UnboundExpressionMode.UseSummaryValues, the expression is calculated against summary values, as follows:

Sum([Extended Price]) / Sum([Quantity]) = (20.8 + 582.4 + 208 + 421.2 + 1248 + 208) / (1 + 28 + 10 + 18 + 60 + 8) = 21.5

NOTE

Unbound expressions evaluated against hidden fields and fields located in the Filter Area return the 'Error' value if the DataFieldUnboundExpressionMode property is set to UnboundExpressionMode.UseSummaryValues, because summary values for these fields are not calculated.

To refer to a field when specifying an unbound expression in code, use the PivotGridField.ExpressionFieldName property.

NOTE

The PivotGridField.FieldName and PivotGridField.Name properties cannot be used in unbound expressions to refer to fields when the DataFieldUnboundExpressionMode property is set to UnboundExpressionMode.UseSummaryValues.

To learn more, see Unbound Fields.

See Also