This is a migrated thread and some comments may be shown as answers.

Difference between Template and ClientTemplate

1 Answer 523 Views
Getting started with ASP.NET
This is a migrated thread and some comments may be shown as answers.
Brandon
Top achievements
Rank 1
Brandon asked on 04 Jun 2014, 04:22 AM
I'm fairly new to programming and sometimes there is so much information out there but for some reason I'm having the hardest time understanding kendo templates. I'm trying to conditionally check if a value is true or false and then set my columns accordingly. I came across a Telerik article that states you can conditionally check using JavaScript:

http://docs.telerik.com/kendo-ui/documentation/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/faq

In my model I am using Razor and creating my columns similar to:

@model IEnumerable<MvcApplication1.Models.Product>

@(Html.Kendo().Grid(Model) // Bind the grid to the Model property of the view
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.ProductID); //Create a column bound to the "ProductID" property
columns.Bound(p => p.ProductName); //Create a column bound to the "ProductName" property
columns.Bound(p => p.UnitPrice); //Create a column bound to the "UnitPrice" property
columns.Bound(p => p.UnitsInStock);//Create a column bound to the "UnitsInStock" property
})
.Pageable() //Enable paging
)

My question is what is the difference between the .Template and .ClientTemplate? Am I still able to use arbitrary JavaScript code in .Template?

Any information would be greatly appreciated!

1 Answer, 1 is accepted

Sort by
1
hadi
Top achievements
Rank 1
answered on 17 Sep 2018, 08:14 AM
The ClientTemplate is used when the Grid is configured for Ajax binding or when server binding is combined with client-side data 
Tags
Getting started with ASP.NET
Asked by
Brandon
Top achievements
Rank 1
Answers by
hadi
Top achievements
Rank 1
Share this question
or