And as a follow up: Can I put in a request that the cell the no records template is placed in be set to colspan ALL of the table columns? Since there is no data to display anyway, and thus no grid, this certainly shouldn't hurt anything, and would give us much more flexibility in the use of the no records template.
5 Answers, 1 is accepted


The way I refresh the grid is very simple, I initiate a RebindGrid command from a button in the CommandItemTemplate and in the ItemCommand event handler set e.Item.Selected = false and reset my data source property to an empty DataTable, then let the default processes happen. That calls my NeedDataSource event handler, which calls my grid data source property, which sets the grid DataSource to the empty DataTable. This part is pretty much verbatim from one of your examples and should have no effect on the resulting display.
To summarize: On initial display the NoRecordsTemplate is apparently forced into the first column of the grid and is narrow and wrapped, but on a subsequent postbacks the NoRecordsTemplate stretches the full width of the grid (which is what I want).
I have assembled a testing project trying to replicate the described issue but without success. I have created NoRecordsTemplate with Label inside of Panel and set ShowHeadersWhenNoRecords to true. The grid is behaving as expected in this scenario.
You could go through attached project and see if there any differences at your end. Additionally, could you provide us with detail information on what you are trying to achieve.
In order to further investigate the issue you could open a formal ticket attaching a sample project demonstrating the unwanted behavior or you could modify the provided one.
Kind regards,
Antonio Stoilkov
the Telerik team

This problem only exists in IE, it works fine in FF, Chrome, and Safari.
In IE the table width is rendered as 1px with overflow hidden, in the other browsers the width is not 1px (in my example below Chrome has a wdith of 196px).
This is from IE:
<div style="width: 100%; height: 627px; overflow: auto;" id="ctl00_ContentPlaceHolderLeftPane_radGridProfiles_GridData" class="rgDataDiv">
<table style="width: 1px; overflow: hidden; table-layout: fixed; text-overflow: ellipsis; empty-cells: show;" id="ctl00_ContentPlaceHolderLeftPane_radGridProfiles_ctl00" class="rgMasterTable rgClipCells rgClipCells">
<colgroup>
<col style="width: 16px;">
<col style="width: 180px;">
</colgroup>
<tbody>
<tr class="rgNoRecords">
<td style="text-align: left;" colSpan="2">
<div style="white-space: nowrap;">
<span id="ctl00_ContentPlaceHolderLeftPane_radGridProfiles_ctl00_ctl04_lblNorec">No Records Found</span>
</div>
</td>
</tr>
</tbody>
</table> </div>
This is from Chrome:
<div id="ctl00_ContentPlaceHolderLeftPane_radGridProfiles_GridData" class="rgDataDiv" style="overflow: auto; width: 100%; height: 76px; ">
<table class="rgMasterTable rgClipCells rgClipCells" id="ctl00_ContentPlaceHolderLeftPane_radGridProfiles_ctl00" style="width: 196px; table-layout: fixed; overflow: hidden; empty-cells: show; ">
<colgroup>
<col style="width:16px">
<col style="width:180px">
</colgroup>
<tbody>
<tr class="rgNoRecords">
<td colspan="2" style="text-align:left;">
<div style="white-space:nowrap;">
<span id="ctl00_ContentPlaceHolderLeftPane_radGridProfiles_ctl00_ctl04_lblNorec">No Records Found</span>
</div>
</td>
</tr>
</tbody>
</table> </div>
Based on your description I have modified the provided project but was not able to replicate the issue. You could take a look at the attached page to see if there are any differences at your end.
Regards,
Antonio Stoilkov
the Telerik team