Arbitrarily bind a clienttemplate to a model

4 posts, 0 answers
  1. Steve
    Steve avatar
    9 posts
    Member since:
    Jun 2012

    Posted 10 Sep 2018 Link to this post

    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);

  2. Neli
    Admin
    Neli avatar
    271 posts

    Posted 12 Sep 2018 Link to this post

    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.
  3. Steve
    Steve avatar
    9 posts
    Member since:
    Jun 2012

    Posted 12 Sep 2018 in reply to Neli Link to this post

    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?

  4. Neli
    Admin
    Neli avatar
    271 posts

    Posted 14 Sep 2018 Link to this post

    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.
Back to Top