This is a migrated thread and some comments may be shown as answers.

NoRecordsTemplate Cut Off

5 Answers 133 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeanne
Top achievements
Rank 1
Jeanne asked on 16 Jun 2012, 03:03 AM
I have a RadGrid with a simple NoRecordsTemplate, just an asp:Panel containing an asp:Label. The label text is fairly long. I do not want the text to wrap, so I specified white-space:nowrap in the css class for the panel. The panel displays narrower than the text, and the text is cut off partway (and outside of the panel). If I add a specific width to the panel, it is cut off as well. I have ShowHeadersWhenNoRecord set to true, and it appears as if the no records template is being placed in a table cell the width of the first column, which would explain why it is being cut off. How do I make the no record template span multiple columns so the full width of it will be displayed?

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

Sort by
0
Jeanne
Top achievements
Rank 1
answered on 16 Jun 2012, 03:16 AM
Additional information: If I set ShowHeaderWhenNoRecords="false" then the NoRecordTemplate displays completely, but stretches the full width of the space where the grid would be if there were one, which is obvious since the panel is style with a border and background color. However since neither the column headers nor the command item template displays, just the no records template, I don't like the way it looks. Although I'd prefer to show the command item template and the column headers when there are no records, if I could display just the command item template along with the no records template that would make me happy.
0
Jeanne
Top achievements
Rank 1
answered on 16 Jun 2012, 07:22 AM
OK, this is really wierd. I decided that, until I get a solution, I would simply accept the NoRecordsTemplate label text wrapping and making the div narrow but taller (but keeping the command item template and column headers displayed). But I discovered during testing that when I refresh the empty grid, the NoRecordsTemplate does display the full width of the table! This is WITH the header and command item still showing!

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).
0
Antonio Stoilkov
Telerik team
answered on 21 Jun 2012, 06:00 AM
Hello Jeanne,

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
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
mmbm
Top achievements
Rank 2
answered on 29 Oct 2012, 07:02 PM
I see the same exact problem when I place a RadGrid in a RadSlidingPane. The width of the no record template is cut off.
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>



0
Antonio Stoilkov
Telerik team
answered on 01 Nov 2012, 08:52 AM
Hi Kevin,

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
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Jeanne
Top achievements
Rank 1
Answers by
Jeanne
Top achievements
Rank 1
Antonio Stoilkov
Telerik team
mmbm
Top achievements
Rank 2
Share this question
or