Skip to main content
A newer version of this page is available. .

MVCxPivotGridWebOptionsData.DataFieldUnboundExpressionMode Property

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

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v18.2.dll

Declaration

public DataFieldUnboundExpressionMode DataFieldUnboundExpressionMode { get; set; }

Property Value

Type Description
DataFieldUnboundExpressionMode

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

Available values:

Name Description
Default

An unbound expression is calculated against each data source record, and then the resulting values are summarized.

UseSummaryValues

An unbound expression is calculated against summary values.

Property Paths

You can access this nested property as listed below:

Object Type Path to DataFieldUnboundExpressionMode
PivotGridSettings
.OptionsData.DataFieldUnboundExpressionMode

Remarks

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

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

DataFieldUnboundExpressionMode

If the DataFieldUnboundExpressionMode property is set to DataFieldUnboundExpressionMode.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 DataFieldUnboundExpressionMode.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 DataFieldUnboundExpressionMode.UseSummaryValues, because summary values for these fields are not calculated.

To refer to a field when specifying an unbound expression in code, use the PivotGridFieldBase.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 DataFieldUnboundExpressionMode.UseSummaryValues.

See Also