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).
Example Comments
Added By: Alan Gali Dev at: 12/20/2012 10:42:00 AM
how can I extend this to apply to entire pivotgrid? I would like all data cells with numeric values to have default formatting of N2 for example.
I'd prefer to not have to loop through all the fields of the pvg as they may be too many
getting error at online demo http://codecentral.devexpress.com/E1874/
Added By: Andrew Aks (DevExpress) at: 8/7/2013 6:40:37 AMWe already fixed this problem. Please try running this demo again.