Here is the code to show the list, it also has a part to show detail information by expanding the record, it shows the details first time you expand the record for some seconds and then clear them , and if you expand it again this time you can see details!
wonder if something triggered to clear the details or what, as it has the details so I don't think it would be matter of reading data!
@(Html.Kendo().Grid(Model)
.Name("LSGrid")
.AutoBind(false)
.NoRecords(x => x.Template("<div class=\"k-grid-norecords-template\">No records found that match your search criteria </div>"))
.Columns(columns =>
{
columns.Bound(p => p.Name).Title("Rail Infrastructure Manager").HeaderHtmlAttributes(new { style = "font-weight: bold" });
columns.Bound(p => p.Ref).Title("Line section ID").HeaderHtmlAttributes(new { style = "font-weight: bold" });
})
.Events(e => e.DetailExpand("detailExpand"))
.ClientDetailTemplateId("template")
.Pageable( pageable => pageable.ButtonCount(10))
.Sortable()
.Scrollable(scr=>scr.Height(300))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.ServerOperation(true)
)
)
<script id="template" type="text/kendo-tmpl">
@(Html.Kendo().Grid<Dto>()
.Name("grid_#=Id#") // template expression, to be evaluated in the master context
.Columns(columns =>
{
columns.Bound(o => o.Id).Title("State/Territory").Width(110);
columns.Bound(o => o.StartKm).Title("Start Km Point").Width(110);
columns.Bound(o => o.EndKm).Title("End Km Point").Width(110);
})
.Pageable()
.ToClientTemplate()
)
</script>
var dataItem = e.sender.dataItem(e.masterRow);
e.detailRow.find(".k-grid").data("kendoGrid").dataSource.data(dataItem.Jurisdictions);
},
Version of Kendo.MvC.dll as reference of project is 2021.2.616
Thanks