Log In
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
  [Expand]Chart Control
  [Expand]Grid View
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Rich Text Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]HTML Editor
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Binding to Data
   [Expand]Data Shaping
   [Expand]Data Analysis
   [Expand]Data Formatting
   [Expand]Data Export
   [Expand]Design-Time Features
   [Expand]UI Elements
    [Expand]Binding to Data
    [Expand]Data Shaping
    [Expand]Data Analysis
    [Collapse]Data Formatting
      How to: Format Cell Values
      How to: Format Cells via Events
    [Expand]Data Export
   [Expand]End-User Capabilities
   [Expand]Member Tables
  [Expand]Tree List
  [Expand]Data Editors
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Report Server
[Expand]eXpressApp Framework
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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=E1874.

The following example shows how to format data that corresponds to 'Quantity' and 'Unit Price' data fields in a sample ASPxPivotGrid control.

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

The 'Unit 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 English (United States) culture the currency values are represented using two digits to the right of the decimal point. In the example, the PivotFieldBase.GrandTotalCellFormat property is used to format grand total cell values for the 'Unit Price' field in a different manner. The data in these cells is formatted as integer currency values (without fractional portions).

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