0
在ASP.NET 3.5我有以下的GridView:ASP.NET/GridView:HeaderStyle-CssClass屬性沒有任何效果
<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>
我試圖做的是有沒有這<thead>
的第一個單元格表具有CSS類"date"
。但是,它似乎沒有任何影響。如果我使用ItemStyle-CssClass
,它確實具有所需的效果,但也適用於所有身體細胞。
我在做什麼錯?
它讓我看起來像這樣的HTML:
<thead>
<tr>
<th scope="col"> <!-- No class :(-->
Date
</th>
...
</tr>
</thead>
你的CSS是如何定義的? – 2009-12-17 16:36:52
@Shawn:你是什麼意思? (我看不出這怎麼重要?) – 2009-12-17 16:38:30
什麼是在「日期」的CSS類?它可能會讓我們知道爲什麼它不起作用。 – adrianos 2009-12-17 16:40:07