Hello,
We are updating a project to the most recent release (2015.3.930), pretty much specifically to fix the whole "No records found" scenario. Currently we use the javascript method people have come up with, putting a setTimeout on the DataBound event of the grid, but this is pretty unreliable and as such, when the official No Records Found came out, we would prefer to use that.
It seems however that in our most unreliable case (a nested grid, 5 levels down, business requirement), the now-built-in NoRecords is not working at all. It works fine on single level grids, but in this instance, when the grid is a Client Template (using .ToClientTemplate() - we use the fluent API for MVC), it doesn't do anything.
I thought maybe it was because we had Pageable disabled (.Pageable(paging => paging.Enabled(false))) and so there was no footer, but even enabling this didn't make it work. The footer correctly detects that there are no items found (as it displays that default message in the bottom right corner), but the .NoRecords("No Records Found!") does not render in the grid, or in the DOM at all.
The below is what gets rendered, which has no message for the no records found.
<table role="grid">
<colgroup>
<col style="width: 22%;">
<col style="width: 21%;">
<col style="width: 40%;">
<col style="width: 10%;">
</colgroup>
<thead class="k-grid-header" role="rowgroup">
<tr role="row">
...
</tr>
</thead>
<tbody role="rowgroup">
<tr class="k-no-data">
<td colspan="4">
</td>
</tr>
</tbody>
</table>
The definition of the subgrid is as follows
<script id="SuperSubGridTemplate" type="text/kendo-tmpl">
@(Html.Kendo().Grid<ReportSuperSubGridVM>()
.Name("SuperSubGrid")
.Columns(column =>
{
column.Bound(x => x.Column1).Width("22%").Title(@Resources.Global.Column1);
column.Bound(x => x.Column2).Width("21%").Title(@Resources.Global.Column2);
column.Bound(x => x.Column3).Width("40%").Title(@Resources.Global.Column3);
column.Bound(x => x.Column4)
.ClientTemplate("\\#if(Column4){\\# " + @Resources.Global.Yes + "\\#}else{\\#" + @Resources.Global.No + "\\#}\\#")
.Width("10%")
.Title(@Resources.Global.Column4);
})
.DataSource(dataBinding => dataBinding
.Ajax()
.PageSize(500)
.Read(read => read.Action("GetSuperSubGridData", Constants.Controller_Report, new
{
Parameter1 = "#=ParentColumn1#"
,Parameter2 = "#=ParentColumn2#"
,Parameter3 = "#=ParentColumn3#"
,Parameter4 = "#=ParentColumn4#"
,Parameter5 = "#=ParentColumn5#"
,Parameter6 = "#=ParentColumn6#"
,Parameter7 = "#=ParentColumn7#"
,Parameter8 = "#=ParentColumn8#"
,Parameter9 = "#=ParentColumn9#"
,Parameter10 = "#=ParentColumn10#"
}))
.Sort(c => c.Add(x => x.Column1))
)
.Scrollable(scrolling => scrolling.Enabled(false))
.Sortable()
.Filterable(filtering => filtering.Enabled(true))
.Pageable(paging => paging.Enabled(false))
.NoRecords(@Resources.Global.NoResultsFound)
.ToClientTemplate()
)
</script>
Again, this works on non-nested grids, but for some reason I can't seem to get it to work on this one.
Thank you for any help!