I have the following GridView in ASP.NET 3.5:
<asp:GridView ID="gvTable" runat="server" AllowSorting="true" ShowHeader="true">
<Columns>
<asp:BoundField DataField="ActivityDate" HeaderText="Date"
HeaderStyle-CssClass="date" />
<asp:BoundField DataField="ActivityType" HeaderText="Type" />
<asp:BoundField DataField="ActivityNotes" HeaderText="Notes" />
</Columns>
<PagerSettings Position="Bottom" Mode="NextPrevious" PageButtonCount="5"
PreviousPageText="Older activities" NextPageText="Newer activities" />
</asp:GridView>
What I'm trying to do is have the first cell of the <thead>
of the table to have the CSS class "date"
. However, it seems to have no effect whatsoever. If I use ItemStyle-CssClass
, it does have the wanted effect, but applies to all of the body cells as well.
What am I doing wrong?
The HTML it gives me looks like this:
<thead>
<tr>
<th scope="col"> <!-- No class :( -->
Date
</th>
...
</tr>
</thead>