New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Defines the fluent API for configuring the Kendo UI PivotGrid

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

T

Syntax:

C#
public class PivotGridBuilder<T> : WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>, IHtmlContent where T : class

Inheritance: objectHelperResultWidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>PivotGridBuilder<T>

Implements: IHtmlContent

Inherited Members WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.ToComponent()WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.Expression(string)WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.Explorer(ModelExplorer)WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.Name(string)WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.Deferred(bool)WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.HtmlAttributes(object)WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.ScriptAttributes(object, bool)WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.Render()WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.ToHtmlString()WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.ToClientTemplate()WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.AsModule(bool)WidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.ComponentWidgetBuilderBase<PivotGrid<T>, PivotGridBuilder<T>>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the PivotGridBuilder<T> class.

C#
public PivotGridBuilder(PivotGrid<T> component)
Parameters:componentPivotGrid<T>

Methods

If set to false the widget will not bind to the data source during initialization. In this case data binding will occur when the change event of the data source is fired. By default the widget will bind to the data source specified in the configuration.

C#
public PivotGridBuilder<T> AutoBind(bool value)
Parameters:valuebool

The value for AutoBind

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

Binds the pivotGrid to a list of objects

C#
public PivotGridBuilder<T> BindTo(IEnumerable<T> dataSource)
Parameters:dataSourceIEnumerable<T>

The data source.

Returns:

PivotGridBuilder<T>

The PivotGridBuilder<T> object to support method chaining.

The template which renders the content of the column header cell. By default it renders the caption of the tuple member.The fields which can be used in the template are: member - the member of the corresponding column header cell or tuple - the tuple of the corresponding column header cell. For information about the tuple structure check this link.

C#
public PivotGridBuilder<T> ColumnHeaderTemplate(string value)
Parameters:valuestring

The value for ColumnHeaderTemplate

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

The template which renders the content of the column header cell. By default it renders the caption of the tuple member.The fields which can be used in the template are: member - the member of the corresponding column header cell or tuple - the tuple of the corresponding column header cell. For information about the tuple structure check this link.

C#
public PivotGridBuilder<T> ColumnHeaderTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the columnheadertemplate.

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

The template which renders the content of the column header cell. By default it renders the caption of the tuple member.The fields which can be used in the template are: member - the member of the corresponding column header cell or tuple - the tuple of the corresponding column header cell. For information about the tuple structure check this link.

C#
public PivotGridBuilder<T> ColumnHeaderTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for ColumnHeaderTemplate

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

The template which renders the content of the column header cell. By default it renders the caption of the tuple member.The fields which can be used in the template are: member - the member of the corresponding column header cell or tuple - the tuple of the corresponding column header cell. For information about the tuple structure check this link.

C#
public PivotGridBuilder<T> ColumnHeaderTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for ColumnHeaderTemplate

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

The template which renders the content of the column header cell. By default it renders the caption of the tuple member.The fields which can be used in the template are: member - the member of the corresponding column header cell or tuple - the tuple of the corresponding column header cell. For information about the tuple structure check this link.

C#
public PivotGridBuilder<T> ColumnHeaderTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for ColumnHeaderTemplate

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

The width of the table columns. Value is treated as pixels.

C#
public PivotGridBuilder<T> ColumnWidth(double value)
Parameters:valuedouble

The value for ColumnWidth

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

Use it to set the Id of the PivotConfigurator.

C#
public PivotGridBuilder<T> Configurator(string configurator)
Parameters:configuratorstring

The configurator

Returns:

PivotGridBuilder<T>

The PivotGridBuilder<T> object to support method chaining.

The template which renders the content of the data cell. By default renders the formatted value (fmtValue) of the data item.The fields which can be used in the template are: 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 or dataItem - the data item itself. For information about the tuple structure check this link. About the data item structure review this help topic.

C#
public PivotGridBuilder<T> DataCellTemplate(string value)
Parameters:valuestring

The value for DataCellTemplate

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

The template which renders the content of the data cell. By default renders the formatted value (fmtValue) of the data item.The fields which can be used in the template are: 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 or dataItem - the data item itself. For information about the tuple structure check this link. About the data item structure review this help topic.

C#
public PivotGridBuilder<T> DataCellTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the datacelltemplate.

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

The template which renders the content of the data cell. By default renders the formatted value (fmtValue) of the data item.The fields which can be used in the template are: 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 or dataItem - the data item itself. For information about the tuple structure check this link. About the data item structure review this help topic.

C#
public PivotGridBuilder<T> DataCellTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for DataCellTemplate

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

The template which renders the content of the data cell. By default renders the formatted value (fmtValue) of the data item.The fields which can be used in the template are: 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 or dataItem - the data item itself. For information about the tuple structure check this link. About the data item structure review this help topic.

C#
public PivotGridBuilder<T> DataCellTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for DataCellTemplate

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

The template which renders the content of the data cell. By default renders the formatted value (fmtValue) of the data item.The fields which can be used in the template are: 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 or dataItem - the data item itself. For information about the tuple structure check this link. About the data item structure review this help topic.

C#
public PivotGridBuilder<T> DataCellTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for DataCellTemplate

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

Sets the data source configuration of the grid.

C#
public PivotGridBuilder<T> DataSource(Action<PivotDataSourceBuilder<T>> configurator)
Parameters:configuratorAction<PivotDataSourceBuilder<T>>

The lambda which configures the data source

Returns:

PivotGridBuilder<T>

The PivotGridBuilder<T> object to support method chaining.

Sets the ID of the DataSource widget used by the PivotGrid.

C#
public PivotGridBuilder<T> DataSource(string dataSourceId)
Parameters:dataSourceIdstring

The name of the DataSource widget

Returns:

PivotGridBuilder<T>

The PivotGridBuilder<T> object to support method chaining.

Configures the client-side events.

C#
public PivotGridBuilder<T> Events(Action<PivotGridEventBuilder> configurator)
Parameters:configuratorAction<PivotGridEventBuilder>

The client events action.

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

Example:
C#
@(Html.Kendo().PivotGrid()
.Name("PivotGrid")
.Events(events =&gt; events
.DataBinding("onDataBinding")
)
)

Configures the Kendo UI PivotGrid Excel export settings.

C#
public PivotGridBuilder<T> Excel(Action<PivotGridExcelSettingsBuilder<T>> configurator)
Parameters:configuratorAction<PivotGridExcelSettingsBuilder<T>>

The PivotGridExcelSettingsBuilder<T> for the excel setting.

Returns:

PivotGridBuilder<T>

Returns the current instance of PivotGridBuilder<T> .

If set to true the user will be able to filter by using the field menu.

C#
public PivotGridBuilder<T> Filterable()
Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

If set to true the user will be able to filter by using the field menu.

C#
public PivotGridBuilder<T> Filterable(bool value)
Parameters:valuebool

The value for Filterable

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

The height of the PivotGrid. Numeric values are treated as pixels.

C#
public PivotGridBuilder<T> Height(double value)
Parameters:valuedouble

The value for Height

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

Sets the KPI Status template of the pivot grid.

C#
public PivotGridBuilder<T> KPIStatusTemplate(string template)
Parameters:templatestring

The template

Returns:

PivotGridBuilder<T>

The PivotGridBuilder<T> object to support method chaining.

Example:
C#
@(Html.Kendo().PivotGrid()
.Name("pivotgrid")
.KPIStatusTemplate("#: dataItem.value #")
.DataSource(dataSource =&gt;
dataSource.Xmla()
.Columns(columns =&gt; columns.Add("[Date].[Calendar]").Expand(true))
.Rows(rows =&gt; rows.Add("[Geography].[City]"))
.Measures(measures =&gt; measures.Values(new string[]{"[Measures].[Internet Sales Amount]"}))
.Transport(transport =&gt; transport
.Connection(connection =&gt; connection
.Catalog("Adventure Works DW 2008R2")
.Cube("Adventure Works"))
.Read(read =&gt; read
.Url("http://demos.telerik.com/olap/msmdpump.dll")
.DataType("text")
.ContentType("text/xml")
.Type(HttpVerbs.Post)
)
)
)
)

the JavaScript function that will return the status template of the pivot grid.

C#
public PivotGridBuilder<T> KPIStatusTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The name of the JavaScript function

Returns:

PivotGridBuilder<T>

The PivotGridBuilder<T> object to support method chaining.

Sets the KPI Status template of the pivot grid.

C#
public PivotGridBuilder<T> KPIStatusTemplateId(string templateId)
Parameters:templateIdstring

The template id

Returns:

PivotGridBuilder<T>

The PivotGridBuilder<T> object to support method chaining.

Example:
C#
@(Html.Kendo().PivotGrid()
.Name("pivotgrid")
.KPIStatusTemplateId("kpiStatusTemplateId")
.DataSource(dataSource =&gt;
dataSource.Xmla()
.Columns(columns =&gt; columns.Add("[Date].[Calendar]").Expand(true))
.Rows(rows =&gt; rows.Add("[Geography].[City]"))
.Measures(measures =&gt; measures.Values(new string[]{"[Measures].[Internet Sales Amount]"}))
.Transport(transport =&gt; transport
.Connection(connection =&gt; connection
.Catalog("Adventure Works DW 2008R2")
.Cube("Adventure Works"))
.Read(read =&gt; read
.Url("http://demos.telerik.com/olap/msmdpump.dll")
.DataType("text")
.ContentType("text/xml")
.Type(HttpVerbs.Post)
)
)
)
)

Sets the KPI Status template of the pivot grid.

C#
public PivotGridBuilder<T> KPIStatusTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The template view

Returns:

PivotGridBuilder<T>

The PivotGridBuilder<T> object to support method chaining.

Example:
C#
@(Html.Kendo().PivotGrid()
.Name("pivotgrid")
.KPIStatusTemplateView(Html.Partial("kpiStatusTemplate"))
.DataSource(dataSource =&gt;
dataSource.Xmla()
.Columns(columns =&gt; columns.Add("[Date].[Calendar]").Expand(true))
.Rows(rows =&gt; rows.Add("[Geography].[City]"))
.Measures(measures =&gt; measures.Values(new string[]{"[Measures].[Internet Sales Amount]"}))
.Transport(transport =&gt; transport
.Connection(connection =&gt; connection
.Catalog("Adventure Works DW 2008R2")
.Cube("Adventure Works"))
.Read(read =&gt; read
.Url("http://demos.telerik.com/olap/msmdpump.dll")
.DataType("text")
.ContentType("text/xml")
.Type(HttpVerbs.Post)
)
)
)
)

Sets the KPI Trend template of the pivot grid.

C#
public PivotGridBuilder<T> KPITrendTemplate(string template)
Parameters:templatestring

The template

Returns:

PivotGridBuilder<T>

The PivotGridBuilder<T> object to support method chaining.

Example:
C#
@(Html.Kendo().PivotGrid()
.Name("pivotgrid")
.KPITrendTemplate("#: dataItem.value #")
.DataSource(dataSource =&gt;
dataSource.Xmla()
.Columns(columns =&gt; columns.Add("[Date].[Calendar]").Expand(true))
.Rows(rows =&gt; rows.Add("[Geography].[City]"))
.Measures(measures =&gt; measures.Values(new string[]{"[Measures].[Internet Sales Amount]"}))
.Transport(transport =&gt; transport
.Connection(connection =&gt; connection
.Catalog("Adventure Works DW 2008R2")
.Cube("Adventure Works"))
.Read(read =&gt; read
.Url("http://demos.telerik.com/olap/msmdpump.dll")
.DataType("text")
.ContentType("text/xml")
.Type(HttpVerbs.Post)
)
)
)
)

Sets the JavaScript function that will return the KPI Trend template of the pivot grid.

C#
public PivotGridBuilder<T> KPITrendTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

the name of the JavaScript function

Returns:

PivotGridBuilder<T>

The PivotGridBuilder<T> object to support method chaining.

Sets the KPI Trend template of the pivot grid.

C#
public PivotGridBuilder<T> KPITrendTemplateId(string templateId)
Parameters:templateIdstring

The template id

Returns:

PivotGridBuilder<T>

The PivotGridBuilder<T> object to support method chaining.

Example:
C#
@(Html.Kendo().PivotGrid()
.Name("pivotgrid")
.KPITrendTemplateId("kpiTrendTemplateId")
.DataSource(dataSource =&gt;
dataSource.Xmla()
.Columns(columns =&gt; columns.Add("[Date].[Calendar]").Expand(true))
.Rows(rows =&gt; rows.Add("[Geography].[City]"))
.Measures(measures =&gt; measures.Values(new string[]{"[Measures].[Internet Sales Amount]"}))
.Transport(transport =&gt; transport
.Connection(connection =&gt; connection
.Catalog("Adventure Works DW 2008R2")
.Cube("Adventure Works"))
.Read(read =&gt; read
.Url("http://demos.telerik.com/olap/msmdpump.dll")
.DataType("text")
.ContentType("text/xml")
.Type(HttpVerbs.Post)
)
)
)
)

Sets the KPI Trend template of the pivot grid.

C#
public PivotGridBuilder<T> KPITrendTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The template view

Returns:

PivotGridBuilder<T>

The PivotGridBuilder<T> object to support method chaining.

Example:
C#
@(Html.Kendo().PivotGrid()
.Name("pivotgrid")
.KPITrendTemplateView(Html.Partial("kpiTrendTemplate"))
.DataSource(dataSource =&gt;
dataSource.Xmla()
.Columns(columns =&gt; columns.Add("[Date].[Calendar]").Expand(true))
.Rows(rows =&gt; rows.Add("[Geography].[City]"))
.Measures(measures =&gt; measures.Values(new string[]{"[Measures].[Internet Sales Amount]"}))
.Transport(transport =&gt; transport
.Connection(connection =&gt; connection
.Catalog("Adventure Works DW 2008R2")
.Cube("Adventure Works"))
.Read(read =&gt; read
.Url("http://demos.telerik.com/olap/msmdpump.dll")
.DataType("text")
.ContentType("text/xml")
.Type(HttpVerbs.Post)
)
)
)
)

Sets the messages of the pivotGrid.

C#
public PivotGridBuilder<T> Messages(Action<PivotGridMessagesBuilder> addViewAction)
Parameters:addViewActionAction<PivotGridMessagesBuilder>

The lambda which configures the pivotGrid messages

Returns:

PivotGridBuilder<T>

The PivotGridBuilder<T> object to support method chaining.

Configures the Kendo UI PivotGrid PDF export settings.

C#
public PivotGridBuilder<T> Pdf(Action<PivotGridPdfSettingsBuilder<T>> configurator)
Parameters:configuratorAction<PivotGridPdfSettingsBuilder<T>>

The PivotGridPdfSettingsBuilder<T> for the pdf setting.

Returns:

PivotGridBuilder<T>

Returns the current instance of PivotGridBuilder<T> .

If set to false the user will not be able to add/close/reorder current fields for columns/rows/measures.

C#
public PivotGridBuilder<T> Reorderable(bool value)
Parameters:valuebool

The value for Reorderable

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

The template which renders the content of the row header cell. By default it renders the caption of the tuple member.The fields which can be used in the template are: member - the member of the corresponding row header cell or tuple - the tuple of the corresponding row header cell. For information about the tuple structure check this link.

C#
public PivotGridBuilder<T> RowHeaderTemplate(string value)
Parameters:valuestring

The value for RowHeaderTemplate

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

The template which renders the content of the row header cell. By default it renders the caption of the tuple member.The fields which can be used in the template are: member - the member of the corresponding row header cell or tuple - the tuple of the corresponding row header cell. For information about the tuple structure check this link.

C#
public PivotGridBuilder<T> RowHeaderTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the rowheadertemplate.

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

The template which renders the content of the row header cell. By default it renders the caption of the tuple member.The fields which can be used in the template are: member - the member of the corresponding row header cell or tuple - the tuple of the corresponding row header cell. For information about the tuple structure check this link.

C#
public PivotGridBuilder<T> RowHeaderTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for RowHeaderTemplate

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

The template which renders the content of the row header cell. By default it renders the caption of the tuple member.The fields which can be used in the template are: member - the member of the corresponding row header cell or tuple - the tuple of the corresponding row header cell. For information about the tuple structure check this link.

C#
public PivotGridBuilder<T> RowHeaderTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for RowHeaderTemplate

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

The template which renders the content of the row header cell. By default it renders the caption of the tuple member.The fields which can be used in the template are: member - the member of the corresponding row header cell or tuple - the tuple of the corresponding row header cell. For information about the tuple structure check this link.

C#
public PivotGridBuilder<T> RowHeaderTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for RowHeaderTemplate

Returns:

PivotGridBuilder<T>

Returns the current PivotGridBuilder<T> instance.

If set to true the user could sort the pivotgrid by clicking the dimension fields. By default sorting is disabled.Can be set to a JavaScript object which represents the sorting configuration.

C#
public PivotGridBuilder<T> Sortable()
Returns:

PivotGridBuilder<T>

Returns the current instance of PivotGridSortableSettingsBuilder<T> .

If set to true the user could sort the pivotgrid by clicking the dimension fields. By default sorting is disabled.Can be set to a JavaScript object which represents the sorting configuration.

C#
public PivotGridBuilder<T> Sortable(Action<PivotGridSortableSettingsBuilder<T>> configurator)
Parameters:configuratorAction<PivotGridSortableSettingsBuilder<T>>

The PivotGridSortableSettingsBuilder<T> for the sortable setting.

Returns:

PivotGridBuilder<T>

Returns the current instance of PivotGridBuilder<T> .

If set to true the user could sort the pivotgrid by clicking the dimension fields. By default sorting is disabled.Can be set to a JavaScript object which represents the sorting configuration.

C#
public PivotGridBuilder<T> Sortable(bool enabled)
Parameters:enabledbool

Enables or disables the sortable option.

Returns:

PivotGridBuilder<T>

Returns the current instance of PivotGridSortableSettingsBuilder<T> .