I have Parent-Child Grid and I need to provide in-line editable feature in parent row in a particular cell. I have tried GridEditMode.InLine editable but it didn't allow to display the grid value. Please help me to find out the problem area below is my code in View:
@model IEnumerable<StarTrax.Mvc.Models.ToFindListViewModel>
@{
ViewData["Title"] = "View";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Bound(e => e.Name).Width(110).Title("List Name");
columns.Bound(e => e.CreatedAt).Width(110).Title("Create Date").Format("{0:MM/dd/yyyy}");
columns.Bound("").Width(110).Title("Created By");
columns.Command(command =>
{
command.Edit();
command.Destroy();
}).Width(120);
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Sortable()
.Pageable()
.Scrollable()
.ClientDetailTemplateId("template")
.HtmlAttributes(new { style = "height:430px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Model(model => model.Id(p => p.EntityId))
.Read(read => read.Action("GetAll", "ToFindList"))
.Update(update => update.Action("Edit", "ToFindList"))
.Destroy(destroy => destroy.Action("Delete", "ToFindList"))
)
.Events(events => events.DataBound("dataBound"))
)
<script id="template" type="text/kendo-tmpl">
@(Html.Kendo().Grid< StarTrax.Mvc.Models.AssetToFindViewModel> ()
.Name("grid_#=EntityId#")
.Columns(columns =>
{
columns.Bound(o => o.Asset.EPC.BarCode).Width(110).Title("Barcode");
columns.Bound(o => o.Asset.SerialNumber).Width(110).Title("Serial Number");
columns.Bound(o => o.Asset.Name).Width(200).Title("Asset Name");
columns.Bound(o => o.Asset.Status).Width(200);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Read(read => read.Action("GetToFindAssets", "ToFindList", new { toFindListId = "#=EntityId#" }))
)
.Pageable()
.Sortable()
.ToClientTemplate()
)
</script>
<script>function dataBound() {
this.expandRow(this.tbody.find("tr.k-master-row").first());
}</script>