I have a grid populated by data from ViewData, and the grid has a column containing an Edit button. The problem is that the ClientTemplate that defines the Edit button is not showing the input button, rather it just shows the Id number as plain text. I've used this same Edit button in another grid that is populated by a model, and it works fine.
Any ideas? Thanks. Dan
Any ideas? Thanks. Dan
@(Html.Kendo().Grid((IEnumerable<
Catheter
>)ViewData["catheters"])
.Name("CatheterGrid")
.Columns(columns =>
{
columns.Bound(e => e.CatheterType.Name).Title("Type");
columns.Bound(e => e.EffectiveDate).Title("Placed On").Format("{0:d}");
columns.Bound(e => e.DiscontinuedOn).Title("Discontinued On");
columns.Bound(e => e.Manufacturer.Name).Title("Manufacturer");
columns.Bound(e => e.ClinicianDisplayName).Title("Clinician");
columns.Bound(e => e.Id).Hidden();
columns.Bound(e => e.Id).ClientTemplate(
"<
a
href
=
'" + Url.Action("EditCatheter", Controllers.Patient) + "/#= Id #'
" + "
class
=
'btn btn-sm'
>Edit</
a
>"
).Width(80).Title("");
})
.Pageable(pageable => pageable
.PageSizes(true).PageSizes(new int[] { 20, 50, 100 })
.ButtonCount(5))
.Sortable()
.Filterable()
.Scrollable()
.ClientDetailTemplateId("template")
.ToolBar(toolbar =>
{
toolbar.Template(@<
text
>
<
div
style
=
"float:right"
>
<
a
href
=
'@Url.Action("EditCatheter", Controllers.Patient)/0'
class
=
'btn btn-sm'
>New</
a
>
</
div
>
</
text
>);
})
)