Templates

The Telerik UI PivotGrid HtmlHelper for ASP.NET Core provides templating options that can be used to customize the way its data is visualized in the table.

Under the hood, the templates use the Kendo UI Templates syntax.

To use templates in the PivotGrid, apply any of the available template options:

Data Cell Template

The data cell template is the template which renders the content of the data cell. By default, it renders the fmtValue formatted value of the data item.

In the data cell template, you can use the following fields:

  • columnTuple—The tuple of the corresponding column header cell.
  • rowTuple—The tuple of the corresponding row header cell.
  • measure—The value of the data cell measure.
  • dataItem—The data item itself.

    @(Html.Kendo().PivotGrid() .Name("pivotgrid") .ColumnWidth(200) .Height(570) .DataCellTemplateId("dataCellTemplate") // Other configuration. )

Column Header Template

The column header template is the template which renders the content of the column header cell. By default, it renders the caption of the tuple member.

In the column header template, you can use the following fields:

  • member—The member of the corresponding column header cell.
  • tuple—The tuple of the corresponding column header cell.

    @(Html.Kendo().PivotGrid() .Name("pivotgrid") .ColumnWidth(200) .Height(570) .ColumnHeaderTemplateId("headerTemplate") // other configuration settings )

Row Header Template

The row header template is the template which renders the content of the row header cell. By default, it renders the caption of the tuple member.

In the row header template, you can use the following fields:

  • member—The member of the corresponding column header cell.
  • tuple—The tuple of the corresponding column header cell.

    @(Html.Kendo().PivotGrid() .Name("pivotgrid") .ColumnWidth(200) .Height(570) .ColumnHeaderTemplateId("headerTemplate") // other configuration settings )

See Also

In this article
Not finding the help you need? Improve this article