Back to Devexpress

How to: Format Cell Values

wpf-8040-controls-and-libraries-pivot-grid-examples-binding-to-data-how-to-format-cell-values.md

latest809 B
Original Source

How to: Format Cell Values

  • Jun 07, 2019

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:

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