By default the Gridview does not use these tags to create its table and often times you will need these elements in client-side scripts:
<table id="myTable">
<thead>
<tr>
<th>Last Name</th>
<th>First Name</th>
<th>Email</th>
<th>Due</th>
<tbody>
<tr>
<td>Smith</td>
<td>John</td>
<td>jsmith@gmail.com</td>
<td>$50.00</td>
</tr>
</tobdy>
</table>
The easiest way to achieve is is to use the page Pre_Render event:
protected void gv_PreRender(object sender, EventArgs e)
{
if (gv.Rows.Count > 0)
{
//Replacing <td> with <th> - just in case
gv.UseAccessibleHeader = true;
//Adding the <thead> and <tbody> elements
gv.HeaderRow.TableSection = TableRowSection.TableHeader;
//This line can be put if you also have footer, it will add <tfoot> element
//If you don't have footer, remove it
gv.FooterRow.TableSection = TableRowSection.TableFooter;
}
}