Show theme settings Shopping cart Download trialFree Trial
Change Theme Settings
Change Theme Settings
Themes
 
Show All Themes
v
...v

Cell Templates

Page 1 of 9 (85 items)Prev123456789Next
Product Sales
Percents
Drop Column Fields Here
Category Name(Ascending)[Filter]
Product Name(Ascending)[Filter]
Grand Total
Product SalesPercents
[Collapse]BeveragesChai$1,332.00
4.58%
Chang$2,280.00
7.83%
Chartreuse verte$887.40
3.05%
Côte de Blaye$12,648.00
43.46%
Guaraná Fantástica$661.50
2.27%
Ipoh Coffee$2,980.80
10.24%
Lakkalikööri$2,188.80
7.52%
Laughing Lumberjack Lager$378.00
1.30%
Outback Lager$1,282.50
4.41%
Rhönbräu Klosterbier$682.00
2.34%
Grand Total$135,119.18
100.00%
Page 1 of 9 (85 items)Prev123456789Next

This demo shows a share of sales per product and per category. This report contains absolute and percent values, and their graphical representation.

You can replace the content of pivot grid cells via templates, as described below:

  1. Create a class that implements the ITemplate interface.
  2. Create an instance of this class, and assign it to the ASPxPivotGrid.CellTemplate property.

The ASPxPivotGrid passes an PivotGridCellTemplateContainer object to the ITemplate.InstantiateIn method. The Value and Text properties contain the current cell's value and display text, respectively.

When implementing the InstantiateIn method, you need to create a web control that will be rendered instead of the cell's content. This control should be added to the PivotGridCellTemplateContainer.Controls collection.

To render a simple text, add a LiteralControl to the PivotGridCellTemplateContainer.Controls collection.


See Also:
Collapse/Expand
Local Copy of this Demo
To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer.
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
Open CS Solution
Open VB Solution
The source code files for this demo are installed (by default) in the following directories:
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\ASPxPivotGridDemos
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\VB\ASPxPivotGridDemos