I have the following Kendo UI grid and i need to render an action link for details page:
@(Html.Kendo().Grid()
.Name("grid")
.Columns(columns =>
{
columns.Bound(c => c.Id).Hidden(true);
@* Invalid line of code as ClientTemplate is waiting for a string *@
columns.Bound(c => c.Name).ClientTemplate(Html.ActionLink("#=Name#", "Details", new { id = "#=Id#" }));
@* Invalid line of code as ClientTemplate is waiting for a string *@
columns.Bound(c => c.Type).Width(100);
columns.Bound(c => c.Subdomain).Width(150);
columns.Bound(c => c.Description);
columns.Bound(c => c.Status).Width(100);
columns.Select().Width(50);
})
.AutoBind(false)
.Scrollable()
.Pageable(pageable => pageable
.Refresh(false)
.PageSizes(true)
.ButtonCount(5))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Read", "Data"))
.PageSize(5)).Deferred())
ClientTemplate method expects a html string.
columns.Bound(c => c.Name).ClientTemplate(string template)
Before .NET Core you'll handle this request in the following manner:
columns.Bound(c => c.Name).ClientTemplate(Html.ActionLink("#=Name#", "Details", new { id = "#=Id#" }).ToHtmlString());
How can we handle this in .NET Core?