views:

525

answers:

3

Is there any way to control the order of which the GridView control renders it's thead, tbody and tfoot child elements?

According to W3C, the correct order is:

  • thead
  • tfoot
  • tbody

The GridView control renders out:

  • thead
  • tbody
  • tfoot


I am extending the GridView control, and I'm using the "first column controls the width of all columns" approach. But if the W3C specifications are not met (thead -> tfoot -> tbody) all hell breaks loose.

I've been reading up on this issue, and it seems that the GridView control has no support for this yet--it's planned though. Even so; I bet there must be some way to counter this sketchy implementation.

Any and all help apreciated.

+1  A: 

If you need strict W3C Validation of your HTML (you must have a valid reason), you better not use ASP.net server controls, because you don't have any control on the HTML they generate.

I bet that this little problem is just the tip of the iceberg of the problems that you will find later.

Eduardo Molteni
Indeed, you cannot rely on server controls for semantic, valid HTML. There's absolutely no guarantee.
Kezzer
A: 

I would imagine that any HTML generated by a Microsoft class will 100% definitely break validation and only work with it's Internet Explorer.

Write your own implementation - or find some Open Source class that will take care of it properly.

"only work with it's Internet Explorer" that really not true.
Eduardo Molteni
A: 

This is not yet possible. Although Microsoft is planning this feature for a future release.

roosteronacid