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

PivotCustomFieldDataEventArgs.Value Property

Gets or sets the value of the cell currently being processed.

Namespace: DevExpress.Xpf.PivotGrid

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

NuGet Packages: DevExpress.WindowsDesktop.Wpf.PivotGrid, DevExpress.Wpf.PivotGrid

Declaration

public object Value { get; set; }

Property Value

Type Description
Object

An object representing the value of the cell currently being processed.

Remarks

Use the Value property to assign a value to the cell currently being processed. This cell is identified by the field (the PivotCustomFieldDataEventArgs.Field property) and row index in the data source (the PivotCustomFieldDataEventArgs.ListSourceRowIndex property). To retrieve values from specific fields in the data source the PivotCustomFieldDataEventArgs.GetListSourceColumnValue method can be used.

Initially the Value property is set to null.

Example

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="http://schemas.devexpress.com/winfx/2008/xaml/pivotgrid" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        Title="MainWindow" Height="600" Width="800" 
        x:Class="UnboundFieldExample.MainWindow"
        Loaded="Window_Loaded">
    <Grid>
        <dxpg:PivotGridControl CustomUnboundFieldData="pivotGridControl1_CustomUnboundFieldData" 
                               CustomCellValue="PivotGridControl1_CustomCellValue" 
                               Name="pivotGridControl1">
            <dxpg:PivotGridControl.Fields>
                <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" 
                                     CellFormat="p"/>
                <dxpg:PivotGridField Name="fieldTotalSum" UnboundType="Decimal" Area="DataArea"
                                     Caption="Total Sum"/>
            </dxpg:PivotGridControl.Fields>
        </dxpg:PivotGridControl>
    </Grid>
</Window>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Value property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also