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.v24.2.dll
NuGet Package: DevExpress.Wpf.PivotGrid
#Declaration
public UnboundExpressionMode DataFieldUnboundExpressionMode { get; set; }
#Property Value
Type | Description |
---|---|
Unbound |
One of the Unbound |
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. |
#Remarks
The DataFieldUnboundExpressionMode property specifies the calculation mode for evaluating the fields within an expression. An expression can be calculated against each data source record, summarizing the resulting values. Another option is to use the field’s summary value in an expression.
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].
If the DataFieldUnboundExpressionMode property is set to UnboundExpressionMode.Default, the unbound expression is calculated against each data source record. The resulting values are summarized. In the pivot grid shown above, the ‘Price Per Unit’ column value in the ‘Gravad lax’ row is 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 using 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
Note
In the Data
To specify an unbound expression mode for a single field, use the field’s PivotGridField.UnboundExpressionMode property.
For more information, refer to the Unbound Fields document.