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

W3C error with NoRecordsTemplate

2 Answers 125 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Reid
Top achievements
Rank 1
Reid asked on 18 Feb 2015, 04:16 PM
I have a RadGrid with three columns. One of those columns is always hidden.

When there are no records in the grid, the grid shows the NoRecordsTemplate, which just display the message "There are no records".

My problem is that I get this W3C error when I run my grid markup through the W3C Validator:
"A table row was 2 columns wide, which is less than the column count established using column markup (3)."

So the problem is that the colspan for the NoRecords td is 2, when it should be 3. It looks like the code is only making the colspan 2 since it's ignoring the hidden column.

Here's the markup with the problem. The W3C error occurs on the fifth to last row, with the rgNoRecords class.

Are there any workarounds for this problem? Thanks.

<th scope="col" class="rgHeader">
  <a onclick="Telerik.Web.UI.Grid.Sort($find('ctl01_TemplateBody_WebPartManager1_gwpciNewDynamicContentCollectionOrganizerCommon_ciNewDynamicContentCollectionOrganizerCommon_Events_ResultsGrid_Grid1_ctl00'), 'Event name'); return false;" id="ctl01_TemplateBody_WebPartManager1_gwpciNewDynamicContentCollectionOrganizerCommon_ciNewDynamicContentCollectionOrganizerCommon_Events_ResultsGrid_Grid1_ctl00_ctl02_ctl01_btn_ResultsGrid_2_Sort_Event_name" title="Click here to sort" href="javascript:__doPostBack('ctl01$TemplateBody$WebPartManager1$gwpciNewDynamicContentCollectionOrganizerCommon$ciNewDynamicContentCollectionOrganizerCommon$Events$ResultsGrid$Grid1$ctl00$ctl02$ctl01$btn_ResultsGrid_2_Sort_Event_name','')">Event name</a>
</th>
<th scope="col" class="rgHeader">
  <a onclick="Telerik.Web.UI.Grid.Sort($find('ctl01_TemplateBody_WebPartManager1_gwpciNewDynamicContentCollectionOrganizerCommon_ciNewDynamicContentCollectionOrganizerCommon_Events_ResultsGrid_Grid1_ctl00'), 'Starting'); return false;" id="ctl01_TemplateBody_WebPartManager1_gwpciNewDynamicContentCollectionOrganizerCommon_ciNewDynamicContentCollectionOrganizerCommon_Events_ResultsGrid_Grid1_ctl00_ctl02_ctl01_btn_ResultsGrid_3_Sort_Starting" title="Click here to sort" href="javascript:__doPostBack('ctl01$TemplateBody$WebPartManager1$gwpciNewDynamicContentCollectionOrganizerCommon$ciNewDynamicContentCollectionOrganizerCommon$Events$ResultsGrid$Grid1$ctl00$ctl02$ctl01$btn_ResultsGrid_3_Sort_Starting','')">Starting</a>
</th>
<th scope="col" class="rgHeader" style="display:none;">
  <a onclick="Telerik.Web.UI.Grid.Sort($find('ctl01_TemplateBody_WebPartManager1_gwpciNewDynamicContentCollectionOrganizerCommon_ciNewDynamicContentCollectionOrganizerCommon_Events_ResultsGrid_Grid1_ctl00'), 'key_UniformKey'); return false;" id="ctl01_TemplateBody_WebPartManager1_gwpciNewDynamicContentCollectionOrganizerCommon_ciNewDynamicContentCollectionOrganizerCommon_Events_ResultsGrid_Grid1_ctl00_ctl02_ctl01_btn_ResultsGrid_5_Sort_0" title="Click here to sort" href="javascript:__doPostBack('ctl01$TemplateBody$WebPartManager1$gwpciNewDynamicContentCollectionOrganizerCommon$ciNewDynamicContentCollectionOrganizerCommon$Events$ResultsGrid$Grid1$ctl00$ctl02$ctl01$btn_ResultsGrid_5_Sort_0','')">
</a>
</th>
</tr>
</thead>
  <tbody>
    <tr class="rgNoRecords">
      <td colspan="2" style="text-align:left;">
        <div>There are no records.</div>
      </td>
    </tr>
  </tbody>

2 Answers, 1 is accepted

Sort by
0
Accepted
Venelin
Telerik team
answered on 23 Feb 2015, 11:53 AM
Hi Reid,

Thank you for driving our attention to this case. We have logged this into our system for further investigation. The reason we are not going to just replace the value is that the grid has always worked this way (with no visual or functional breaks). We would like to first test it well on all browsers and actually see why it is left like this (but I suspect it's because of IE7).

For now you can safely ignore the error, i.e. it won't cause any trouble. I understand your concern about the HTML validation, but currently it's best to research before taking risky actions or providing workarounds.

Your Telerik points have been increased accordingly, thank you once again for the valuable feedback.

Regards,
Venelin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Reid
Top achievements
Rank 1
answered on 23 Feb 2015, 02:43 PM
Thank you for your response.
Tags
Grid
Asked by
Reid
Top achievements
Rank 1
Answers by
Venelin
Telerik team
Reid
Top achievements
Rank 1
Share this question
or