Time 列の値が 30 より大きい場合に行の背景色を変更する方法を見つけようとしています。以下は私のコードです。
<asp:GridView ID="gvMyDetails" runat="server" AutoGenerateColumns="False" AllowSorting="true" CellPadding="0"
Width="730px" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px"
Font-Bold="True" ForeColor="Black" OnSelectedIndexChanged="gvMyDetails_SelectedIndexChanged"
Style="text-align: center">
<Columns>
<!-- Other asp:TemplateFields... -->
<asp:TemplateField HeaderText="Time" HeaderStyle-BackColor="#4b6c9e">
<ItemTemplate>
<asp:Label ID="lblTime" runat="server" Text='<%# Bind("Time") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#CCCCCC" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#CCCCCC" />
</asp:GridView>
SqlDataReader myReader4 = null;
SqlCommand myCommand4 = new SqlCommand("SELECT Account_Number, Std_Note_Code, Std_Note_Description, CONVERT(varchar(12), Std_Note_Date_Entered, 101) as datedate, Std_Note_Time_Entered, Time FROM qa_bor, qa_users where (qa_bor.Std_Note_Creator_Name = qa_users.username_bor and qa_users.username_bor = '" + ddlrep.Text + "') and (qa_bor.Std_Note_Date_Entered >= '" + datefrom + "' and qa_bor.Std_Note_Date_Entered <= '" + dateto + "') ORDER BY Std_Note_Date_Entered ASC", myConnection);
myReader4 = myCommand4.ExecuteReader();
if (myReader4.HasRows)
{
gvMyDetails.DataSource = myReader4;
gvMyDetails.DataBind();
myReader4.Close();
}