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

ClientTemplate not displaying correctly

2 Answers 341 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 19 Sep 2017, 06:31 PM

I know I've done this before, but for some reason, it's just not working for me today.  What am I missing:

@(Html.Kendo().Grid((IEnumerable<Provider>)ViewData["providers"])
    .Name("providerGrid")
    .Columns(cols =>
    {
 
        cols.Bound(c => c.ProviderName);
        cols.Bound(c => c.Active).ClientTemplate("#= Active ? 'Yes' : 'No' #");
    })
)

 

See the screen shot I attached, it just shows a disabled checkbox for the field.

2 Answers, 1 is accepted

Sort by
0
Joe
Top achievements
Rank 1
answered on 19 Sep 2017, 07:28 PM

Nevermind, I found it.  To use the .ClientTemplate() format I want to use, it has to be an .Ajax() call...  

0
Stefan
Telerik team
answered on 21 Sep 2017, 08:36 AM
Hello, Joe,

Indeed, the ClientTemplate is available only with Ajax bound Grids. For the server bound Grid the Template property can be used:

http://docs.telerik.com/aspnet-mvc/helpers/grid/faq#how-to-customize-the-way-properties-are-displayed-in-grid-bound-columns

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Joe
Top achievements
Rank 1
Answers by
Joe
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or