【发布时间】:2014-10-30 09:07:24
【问题描述】:
我想根据某些条件更改 gridview 的特定行颜色,我正在使用带有 c# 的 ASP.NET。 这是示例输出:
<cc1:PagingGridView ID="TaskNameGrid"
runat="server"
AllowPaging="True"
AutoGenerateColumns="False"
CssClass="SearchResultsTable"
ShowHeader="true"
virtualitemcount1="-1"
OnRowdatabound="TaskNameGrid_Rowdatabound"
OnRowCancelingEdit="TaskNameGrid_RowCancelingEdit"
OnRowEditing="TaskNameGrid_RowEditing"
OnRowUpdating="TaskNameGrid_RowUpdating"
Width="400px">
<AlternatingRowStyle CssClass="alternate" />
<HeaderStyle ForeColor="White" />
<RowStyle />
<Columns>
<asp:BoundField HeaderText="Task Name" DataField="BusinessIdentifier" SortExpression="BusinessIdentifier" ReadOnly="True"></asp:BoundField>
<asp:TemplateField HeaderText="SLA" InsertVisible="False" SortExpression="sno">
<EditItemTemplate>
<asp:TextBox ID="SlaVariationTextBox" runat="server" Text='<%# Bind("SLA") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("SLA", "not set") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowEditButton="true" />
</Columns>
</cc1:PagingGridView>
提前致谢
【问题讨论】: