Skip to main content

PivotCustomFieldDataEventHandler Delegate

Represents a method that will handle the PivotGridControl.CustomUnboundFieldData event.

Namespace: DevExpress.Xpf.PivotGrid

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

NuGet Package: DevExpress.Wpf.PivotGrid


public delegate void PivotCustomFieldDataEventHandler(
    object sender,
    PivotCustomFieldDataEventArgs e


Name Type Description
sender Object

The event source. This parameter identifies the PivotGridControl which raised the event.

e PivotCustomFieldDataEventArgs

A PivotCustomFieldDataEventArgs object which contains event data.


When creating a PivotCustomFieldDataEventHandler delegate, you identify the method that will handle the corresponding event. To associate an event with your event handler, add a delegate instance to this event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event handler delegates, see Events and Delegates in MSDN.


This example demonstrates how to add an unbound field to the PivotGridControl, to show the total sum of an order.

The PivotGridControl is bound to the Order Details data table (from the nwind sample database), which contains UnitPrice, Quantity and Discount fields. The total sum is calculated as follows: UnitPriceQuantity(1-Discount).

To solve this task, create a PivotGrid’s field and set its PivotGridField.UnboundType property to FieldUnboundColumnType.Decimal. Then, handle the PivotGridControl.CustomUnboundFieldData event and populate the field with data.

View Example

<Window xmlns:dxpg="" 
        Title="MainWindow" Height="600" Width="800" 
        <dxpg:PivotGridControl CustomUnboundFieldData="pivotGridControl1_CustomUnboundFieldData" 
                <dxpg:PivotGridField Name="fieldOrderID" FieldName="OrderID" Area="RowArea"/>
                <dxpg:PivotGridField Name="fieldProductName" FieldName="ProductName" Area="RowArea"/>
                <dxpg:PivotGridField Name="fieldUnitPrice" FieldName="UnitPrice" Area="DataArea"/>
                <dxpg:PivotGridField Name="fieldQuantity" FieldName="Quantity" Area="DataArea"/>
                <dxpg:PivotGridField Name="fieldDiscount" FieldName="Discount" Area="DataArea" 
                <dxpg:PivotGridField Name="fieldTotalSum" UnboundType="Decimal" Area="DataArea"
                                     Caption="Total Sum"/>
See Also