I am binding a Kendo grid using Ajax binding. In the last column of the grid I want to show action buttons based on the status. In html I have a kendo template. But im not sure how to set kendo template in grid column using it's ID.
I'm open for any other suggestions, if there are any other ways to do this.
<
div
>
@(Html.Kendo().Grid<
BatchDetail
>()
.Name("grid")
.Columns(col =>
{
col.Bound(p => p.ID);
col.Bound(p => p.OriginalCost);
col.Bound(p => p.Status);
//how do I add new column here which is not bound to any property, but it need to render a template below
})
.AutoBind(true)
.Pageable()
.Sortable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read
.Action("GetData", "Detail", new { ID = Model.ID })))
)
</
div
>
<
script
id
=
"action-template"
type
=
"text/x-kendo-template"
>
#if(Status == "Error") {#
<
button
class
=
"resolve-button"
onclick
=
"location.href='@Url.Action("
DoAction", "Detail")?fileID=#: FileID #&ID=#: ID#'">
Resolve
</
button
>
#}#
</
script
>