我要做的就是将网格视图的最后三列设为黄色。因为我正在使用 css,我不能在 boundfield 中使用 itemstyle 吗?如果不是,我怎么能轻松做到这一点?谢谢!
<asp:GridView
ID="grdMyProducts"
DataSourceID = "srcGetMyProducts"
CssClass="GridViewStyle"
AutoGenerateColumns = "false"
AllowPaging = "false"
GridLines="None"
runat="server" >
<RowStyle CssClass="RowStyle" />
<EmptyDataRowStyle CssClass="EmptyRowStyle" />
<PagerStyle CssClass="PagerStyle" />
<SelectedRowStyle CssClass="SelectedRowStyle" />
<HeaderStyle Wrap="false" CssClass="HeaderStyleFilter" />
<EditRowStyle CssClass="EditRowStyle" />
<AlternatingRowStyle CssClass="AltRowStyle" />
<Columns>
<asp:BoundField
DataField="DistributorName"
HeaderText="Distributor" />
<asp:BoundField
DataField="Size"
HeaderText="Size" />
<asp:BoundField
DataField="Description"
HeaderText="Description" />
<asp:BoundField
DataField="Category"
HeaderText="Category" />
<ItemStyle BackColor="#f6f17c"/>
<asp:BoundField
DataField="Amount"
HeaderText="Amount" />
<ItemStyle BackColor="#f6f17c"/>
<asp:BoundField
DataField="Unit"
HeaderText="Unit" />
<ItemStyle BackColor="#f6f17c"/>
</Columns>
</asp:GridView>