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

Missing Server-Bound Template

3 Answers 152 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JamesD
Top achievements
Rank 1
JamesD asked on 17 Mar 2021, 03:52 PM

Hello,

 

In old Kendo.Mvc I was using following method to generate sever side Template for column.

Now I'm migrating project to ASP Net Core and this method is missing, is it moved to somewhere else?

public virtual GridTemplateColumnBuilder<TModel> Template( Func<TModel, object> template );

 

columns.Template( c => @Html.ActionLink( c[column_name].ToString(), "actionName",
            new { encrypted_id = Shared.EncryptId( c[column_id] ) } )
            .ToHtmlString() ).Title( "Column Title" );

3 Answers, 1 is accepted

Sort by
1
Anton Mironov
Telerik team
answered on 22 Mar 2021, 10:27 AM

Hi James,

Thank you for the code snippets and details provided.

In order to achieve the desired behavior, I would recommend using the "ClientTemplate" functionality. The following article demonstrates different ways of its implementation and usability:

Give a try to the approach above and let me know if further assistance is needed.

 

Kind Regards,
Anton Mironov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
JamesD
Top achievements
Rank 1
answered on 22 Mar 2021, 03:45 PM

Hi, yes I already started using this approach, but it is a client side, and I cannot call any C# functions in ClientTemplate.

So i will just try to avoid it.

 

Thank you

0
Anton Mironov
Telerik team
answered on 25 Mar 2021, 11:23 AM

Hi James,

In order to use the Controller Actions, I would recommend using a function in the Template. A similar approach is shown in the last example of this article.

In the function handler, use an Ajax request to achieve the desired behavior.

I hope this information helps.

Best Regards,
Anton Mironov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
JamesD
Top achievements
Rank 1
Answers by
Anton Mironov
Telerik team
JamesD
Top achievements
Rank 1
Share this question
or