Default.aspx
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField>
<HeaderTemplate><table border="1" style="border-collapse:collapse"><tr><th>ID</th><th>Title</th><th>Message</th></tr></HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Label ID="lbl_ID" runat="server" Text='<%#Eval("ID") %>'/></td>
<td><asp:Label ID="lbl_Msg" runat="server" Text='<%#Eval("Messge") %>'/></td>
<td><asp:Label ID="lbl_Status" runat="server" Text='<%#Eval("Status") %>'/></td>
</tr>
</ItemTemplate>
<FooterTemplate></table></FooterTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Default.aspx.cs
string s = "data source=localhost;initial catalog=xxx;user id=sa;password=pas@123";
SqlConnection Conn = new SqlConnection(s);
Conn.Open();
SqlDataAdapter Adapter = new SqlDataAdapter("Select * from t1", Conn);
DataTable Bind = new DataTable();
Adapter.Fill(Bind);
GridView1.DataSource = Bind;
GridView1.DataBind();
Conn.Close();
foreach (GridViewRow item in GridView1.Rows)
{
Label l = (Label)item.FindControl("lbl_Status");
if (l.Text == "Fail")
l.BackColor = System.Drawing.Color.Red;
}