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.v24.2.dll
NuGet Package: DevExpress.Web.Mvc5
#Declaration
public DataFieldUnboundExpressionMode DataFieldUnboundExpressionMode { get; set; }
#Property Value
Type | Description |
---|---|
Data |
One of the Data |
Available values:
Name | Description |
---|---|
Default | An unbound expression is calculated against each data source record, and then the resulting values are summarized. |
Use |
An unbound expression is calculated against summary values. |
#Property Paths
You can access this nested property as listed below:
Object Type | Path to Data |
---|---|
Pivot |
|
#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].
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 Data
To refer to a field when specifying an unbound expression in code, use the PivotGridFieldBase.ExpressionFieldName property.
Note
The Pivot