Back to Devexpress

ASPxPivotGrid.HeaderTemplate Property

aspnet-devexpress-dot-web-dot-aspxpivotgrid-dot-aspxpivotgrid-6f684811.md

latest2.8 KB
Original Source

ASPxPivotGrid.HeaderTemplate Property

Gets or sets a template to display the content of field headers.

Namespace : DevExpress.Web.ASPxPivotGrid

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

NuGet Package : DevExpress.Web

Declaration

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

Property Value

TypeDefaultDescription
ITemplatenull

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

|

Remarks

By creating a template of the HeaderTemplate type, you can define the custom content displayed for all field headers in the ASPxPivotGrid control. The appearance settings used to paint field headers can be specified by the PivotGridStyles.HeaderStyle or PivotGridField.HeaderStyle property.

The content of a particular field header can be defined using the field’s PivotGridField.HeaderTemplate property, which takes precedence over the HeaderTemplate property.

This example demonstrates how to customize the Field Header and Field Value templates:

cs
public class HeaderTemplate :ITemplate {
    public void InstantiateIn(Control container) {
        PivotGridHeaderTemplateContainer c = (PivotGridHeaderTemplateContainer)container;
        PivotGridHeaderHtmlTable table = c.CreateHeader();
        table.Content = new HeaderLink();
        c.Controls.Add(table);
    }
}

Note

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

See Also

HeaderTemplate

ASPxPivotGrid Class

ASPxPivotGrid Members

DevExpress.Web.ASPxPivotGrid Namespace