New to Telerik UI for ASP.NET MVC? Download free 30-day trial

PivotGridV2Builder

Defines the fluent API for configuring the Kendo PivotGridV2 for ASP.NET MVC.

Methods

AutoBind(System.Boolean)

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.

Parameters

value - System.Boolean

The value that configures the autobind.

Pdf(System.Action)

Configures the Kendo UI PivotGridV2 PDF export settings.

Parameters

configurator - System.Action<PivotGridV2PdfSettingsBuilder>

The action that configures the pdf.

ColumnWidth(System.Double)

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

Parameters

value - System.Double

The value that configures the columnwidth.

Height(System.Double)

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

Parameters

value - System.Double

The value that configures the height.

ColumnHeaderTemplate(System.String)

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.

Parameters

value - System.String

The value that configures the columnheadertemplate.

ColumnHeaderTemplateId(System.String)

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.

Parameters

value - System.String

The value that configures the columnheadertemplate.

DataCellTemplate(System.String)

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.

Parameters

value - System.String

The value that configures the datacelltemplate.

DataCellTemplateId(System.String)

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.

Parameters

value - System.String

The value that configures the datacelltemplate.

RowHeaderTemplate(System.String)

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.

Parameters

value - System.String

The value that configures the rowheadertemplate.

RowHeaderTemplateId(System.String)

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.

Parameters

value - System.String

The value that configures the rowheadertemplate.

Events(System.Action)

Configures the client-side events.

Parameters

configurator - System.Action<PivotGridV2EventBuilder>

The client events action.

Example


             @( Html.Kendo().PivotGridV2()
                        .Name("PivotGridV2")
                        .Events(events => events
                            .DataBinding("onDataBinding")
                        )
            )

DataSource(System.Action)

The data source of the widget which is used to display values. Can be a JavaScript object which represents a valid data source configuration or an existing kendo.data.PivotDataSourceV2 instance.If the dataSource option is set to a JavaScript object the widget will initialize a new kendo.data.PivotDataSourceV2 instance using that value as data source configuration.If the dataSource option is an existing kendo.data.PivotDataSourceV2 instance the widget will use that instance and will not initialize a new one.

Parameters

configurator - System.Action<PivotDataSourceV2Builder>

DataSource(System.String)

Parameters

dataSourceId - System.String

Configurator(System.String)

Use it to set the Id of the PivotConfigurator.

Parameters

configurator - System.String

The configurator

BindTo(System.Collections.Generic.IEnumerable)

Binds the pivotGrid to a list of objects

Parameters

dataSource - System.Collections.Generic.IEnumerable<TModel>

The data source.

ToComponent()

Returns the internal view component.

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name of the component.

Example


            @(Html.Kendo().Grid<OrderViewModel>()
               .Name("grid")
               .Columns(columns =>
               {
                   columns.Bound(p => p.OrderID).Filterable(false);
                   columns.Bound(p => p.Freight);  
               })
               .DataSource(dataSource => dataSource
                   .Ajax()
                   .PageSize(20)
                   .Read(read => read.Action("Orders_Read", "Grid"))
               )
            )

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with Kendo.Mvc.UI.Fluent.WidgetFactory.DeferredScripts(System.Boolean)

Parameters

deferred - System.Boolean

ModelMetadata(System.Web.Mvc.ModelMetadata)

Uses the Metadata of the Model.

Parameters

modelMetadata - System.Web.Mvc.ModelMetadata

The metadata set for the Model

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

Render()

Renders the component.

Example


            @(@Page Inherits="System.Web.Mvc.ViewPage<IEnumerable<Product>>" )
            @( Html.Kendo().Grid(Model)
                .Name("grid")
                .DetailTemplate(product => {
                    )
                       Product Details:
                       <div>Product Name: @( product.ProductName )</div>
                       <div>Units In Stock: @( product.UnitsInStock )</div>
                    @(
                })
                .Render();
            )

ToHtmlString()

ToClientTemplate()

In this article
Not finding the help you need?