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

Arbitrarily bind a clienttemplate to a model

3 Answers 41 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 10 Sep 2018, 08:17 AM

Is there a way to simply bind a clienttemplate [String] to a model? I'm not talking about any particular control.

@Html.Kendo.Bind("<a href='/Foo/# =ID #'>link</a>", Model);

3 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 12 Sep 2018, 08:07 AM
Hello Steve,

In order to enable the client template you will need to use the ClientTemplate or ClientTemplateId methods. Please refer to the examples below:
- https://docs.telerik.com/aspnet-mvc/helpers/notification/overview#configuration-Templates
- https://docs.telerik.com/aspnet-mvc/helpers/grid/configuration#clienttemplate

Regards,
Neli
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Steve
Top achievements
Rank 1
answered on 12 Sep 2018, 08:12 AM

Hi Neli

I do not wish to use a particular Kendo control, I simply want to use the Kendo API to bind an arbitrary client template to some data.

For example, in razor:

@Html.Kendo.Bind("<a href='/Foo/# =ID #'>link</a>", Model);

Can this be done?

0
Neli
Telerik team
answered on 14 Sep 2018, 06:45 AM
Hello Steve,

You could create a template to render some data by using JavaScript as in the article I have sent you previously (linked here as well). You could find more example in the following Demo. The demonstrated examples could not be achieved by using Razor syntax. 

Regards,
Neli
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Steve
Top achievements
Rank 1
Answers by
Neli
Telerik team
Steve
Top achievements
Rank 1
Share this question
or