Back to Devexpress

ASPxPivotGrid.CellTemplate Property

aspnet-devexpress-dot-web-dot-aspxpivotgrid-dot-aspxpivotgrid-68f677f0.md

latest3.5 KB
Original Source

ASPxPivotGrid.CellTemplate Property

Gets or sets a template to display the content of cells.

Namespace : DevExpress.Web.ASPxPivotGrid

Assembly : DevExpress.Web.ASPxPivotGrid.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(null)]
public virtual ITemplate CellTemplate { get; set; }
vb
<DefaultValue(Nothing)>
Public Overridable Property CellTemplate As ITemplate

Property Value

TypeDefaultDescription
ITemplatenull

An object supporting the System.Web.UI.ITemplate interface that contains the custom content for cells.

|

Remarks

By creating a template of the CellTemplate type, you can define the custom content displayed for cells in the ASPxPivotGrid control. The cell appearance can be controlled by the PivotGridStyles.CellStyle or PivotGridField.CellStyle property.

Note

Once a template defined via the CellTemplate property is created within a control, it is instantiated within a container object of the PivotGridCellTemplateContainer type. This container object exposes a set of specific properties to which the template’s child controls can be bound.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CellTemplate property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

web-forms-pivot-grid-customize-cell-appearance-via-templates/CS/ASPxPivotGrid_CellTemplates/Default.aspx.cs#L11

csharp
protected void Page_Load(object sender, EventArgs e) {
    ASPxPivotGrid1.CellTemplate = new CellTemplate();
}

web-forms-pivot-grid-customize-cell-appearance-via-templates/VB/ASPxPivotGrid_CellTemplates/Default.aspx.vb#L14

vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    ASPxPivotGrid1.CellTemplate = New CellTemplate()
End Sub

See Also

ASPxPivotGrid Class

ASPxPivotGrid Members

DevExpress.Web.ASPxPivotGrid Namespace