Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Binding to Data
   [Collapse]Data Shaping
    [Expand]Aggregation
     Grouping
    [Expand]Sorting
    [Expand]Filtering
    [Collapse]Data Formatting
      Standard Formatting
      Custom Formatting
   [Expand]Data Analysis
   [Expand]Layout
   [Expand]Printing and Exporting
   [Expand]Appearance
   [Expand]MVVM Enhancements
   [Expand]Miscellaneous
   [Expand]UI Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Standard Formatting

The Pivot Grid allows you to format the display text of its summary cells, field values, totals and grand totals before they are displayed. You can apply the standard formatting mechanism described in the Standard Numeric Format Strings, Custom Numeric Format Strings, Standard Date and Time Format Strings and Custom Date and Time Format Strings MSDN topics, or implement a custom formatting rule.

Expanded Formatting Summary Cells

To format summary cells, use the data field's PivotGridField.CellFormat property.

Expanded Formatting Field Values

To format field values, use the field's PivotGridField.ValueFormat property.

Expanded Formatting Totals and Grand Totals

To format total and grand total cells, use the PivotGridField.TotalCellFormat and PivotGridField.GrandTotalCellFormat properties, respectively. The format of total headers is specified by the PivotGridField.TotalValueFormat property. You can also provide formatting settings for individual custom totals. Use the PivotGridCustomTotal.CellFormat and PivotGridCustomTotal.Format properties to format custom total cells and headers, respectively.

Expanded Example: How to Format Cell Values

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E2139.

This example demonstrates how to format values in a pivot grid cells. In this sample, it is illustrated how to format data that corresponds to Quantity and Extended Price data fields in a PivotGridControl.

For the Quantity field the PivotGridField.CellFormat property is used to format data in a custom manner. The values that correspond to this field are enclosed with round brackets. The formatting settings specified by the PivotGridField.CellFormat property also affect the representation of total and grand total cells.

The Extended Price field is bound to a field that contains currency data. By default the cell values that correspond to such fields are formatted as currency amounts (the formatting settings are determined by the regional settings). For the "English (United States)" culture, the currency values are represented using two digits to the right of the decimal point. In the example, the PivotGridField.GrandTotalCellFormat property is used to format grand total cell values for the Extended Price field in a different manner. The data in these cells is formatted as integer currency values (without fractional portions).

Is this topic helpful?​​​​​​​