Quantcast
Viewing all articles
Browse latest Browse all 7205

How to Customize Cell Appearance via Templates


This example shows a share of sold units quantity per salesperson. This report contains absolute and percent values, and their graphical representation.

The content of pivot grid cells is replaced via templates, as described below:

1. A class that implements the ITemplate interface is created.
2. An instance of this class is created and assigned to the ASPxPivotGrid.CellTemplate property.

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

When implementing the InstantiateIn method, a web control is created to be rendered instead of the cell's content. This control is added to the PivotGridCellTemplateContainer.Controls collection.

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

Example Comments

Added By: Himanshu Sekhar Behera at: 7/17/2013 5:42:19 AM    

This Example giving an error.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>