PivotGridOptionsData.DataFieldUnboundExpressionMode Property

Gets or sets whether unbound expressions for pivot grid's data fields are calculated based on the data source records or summary values.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.PivotGrid.v20.1.Core.dll

Declaration

[DefaultValue(DataFieldUnboundExpressionMode.Default)]
public DataFieldUnboundExpressionMode DataFieldUnboundExpressionMode { get; set; }
<DefaultValue(DataFieldUnboundExpressionMode.Default)>
Public Property DataFieldUnboundExpressionMode As DataFieldUnboundExpressionMode

Property Value

Type Default Description
DataFieldUnboundExpressionMode

Default

A DataFieldUnboundExpressionMode enumeration member specifying the calculation mode.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to DataFieldUnboundExpressionMode
WinForms Controls PivotGridControl
.OptionsData.DataFieldUnboundExpressionMode
ASP.NET Controls and MVC Extensions ASPxPivotGrid
.OptionsData.DataFieldUnboundExpressionMode
MVCxPivotGrid
.OptionsData.DataFieldUnboundExpressionMode
PivotGridSettings
.OptionsData.DataFieldUnboundExpressionMode
Reporting XRPivotGrid
.OptionsData.DataFieldUnboundExpressionMode
XRPivotGrid
.OptionsData.DataFieldUnboundExpressionMode

Remarks

The DataFieldUnboundExpressionMode property specifies the calculation mode for evaluating an unbound field's expression for all fields with the default PivotGridFieldBase.UnboundExpressionMode setting. 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.

NOTE

The field's PivotGridFieldBase.UnboundExpressionMode property with a value other than the UnboundExpressionMode.Default has priority over the DataFieldUnboundExpressionMode setting.

An example, which illustrates the use of different modes in real-life scenario, is the Year End bonus and Quantity bonus calculation.

The image below shows the WinForms Pivot Grid with the 'drill down' Underlying Data Source form invoked. The 'Year End Bonus' and 'Quantity Bonus' fields are unbound, have different expressions and calculation modes, as described in the table below.

TIP

If you have the Demo Center installed, review the Unbound Fields demo.

UnboundFieldsExpressionMode

Year End Bonus

Quantity Bonus

Description

The Year-End Bonus is $600 in fourth quarter if that quarter’s sales exceeded $20,000. If the sales were lower than the threshold, the bonus is $400. Sales for a quarter are defined as the sum of Extended Price from all orders – meaning that calculations are based on summary values.

The Quantity Bonus accumulates a 5% bonus on each individual order that exceeded 50 units. In this case, calculations are based on values from underlying data source records, as you can inspect using the Underlying Data Source window.

Calculation Mode Setting

Set the DataFieldUnboundExpressionMode property to UnboundExpressionMode.UseSummaryValues and the field's PivotGridFieldBase.UnboundExpressionMode property to UnboundExpressionMode.Default or UnboundExpressionMode.UseSummaryValues;

- or leave the DataFieldUnboundExpressionMode property intact (default value is UnboundExpressionMode.Default) and set the field's PivotGridFieldBase.UnboundExpressionMode property to UnboundExpressionMode.UseSummaryValues;

Set the DataFieldUnboundExpressionMode property to UnboundExpressionMode.UseSummaryValues and the field's PivotGridFieldBase.UnboundExpressionMode property to UnboundExpressionMode.DataSource;

- or leave the DataFieldUnboundExpressionMode property intact (default value is UnboundExpressionMode.Default) and set the field's PivotGridFieldBase.UnboundExpressionMode property to UnboundExpressionMode.Default or UnboundExpressionMode.DataSource;

NOTE

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 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.

See Also