I want to add a class name to some of my BoundFields in the GridView control; so that once the GridView is data-bound and rendered I can obtain something like:
<td class="Tag1">Some data came from data source</td>
The purpose of doing such a thing is to be able to find all the elements that are "Tag1" in this way:
var allTag1td = $('td.Tag1');
So, how can I add this class to the BoundField so that it is rendered in this way?
Add the ItemStyle property to your field:
<asp:BoundField DataField="Count" HeaderText="Count">
<ItemStyle CssClass="yourclass"></ItemStyle>
</asp:BoundField>