Skip to main content

How to: Format Cell Values

The following example shows how to format Order Date field values and summaries corresponding to the Extended Price field. Order Date field values are formatted using a long date pattern while Extended Price summaries are formatted as integer currency values.

The result of the code is shown below:

WpfPivot_Formatting_Example

<dxpg:PivotGridControl.Fields>
    <dxpg:PivotGridField Area="DataArea" FieldName="Extended_Price" CellFormat="c0"/>
    <dxpg:PivotGridField Area="RowArea" FieldName="OrderDate" GroupInterval="Date" ValueFormat="D"/>
    <dxpg:PivotGridField Area="ColumnArea" FieldName="Country"/>  
</dxpg:PivotGridControl.Fields>