Hello Everyone,
Based on my previous post, I need some suggestion. I wasnt sure if I have to continue with the old post or create a new one.
I have a gridview which has the following TemplateField.
onRowDataBound I need to change the color of [, :, ] text to Black. Else gray all the time.
I have the following code onRowDataBound.
Do I need to use as a label control for "[" text as to change the color? Or is there any other way?
Thanks in advance for any ideas/suggestion.
Based on my previous post, I need some suggestion. I wasnt sure if I have to continue with the old post or create a new one.
I have a gridview which has the following TemplateField.
Code:
<asp:GridView id="grd" runat="server" OnRowDataBound="grd_RowDataBound">
<asp:TemplateField HeaderText="Closed" SortExpression="Closed">
<ItemTemplate>
<asp:Label ID="lblClosed_Total" runat="server" Text='<%# Bind("Closed_Total") %>' ForeColor="Blue"></asp:Label>
[
<asp:Label ID="lblClosed_High" runat="server" Text='<%# Bind("Closed_High") %>' ForeColor="Red"></asp:Label>
]
</ItemTemplate>
</GridView>
onRowDataBound I need to change the color of [, :, ] text to Black. Else gray all the time.
I have the following code onRowDataBound.
Code:
if (e.Row.RowType != DataControlRowType.DataRow)
{
return;
}
Label lbl = (Label)e.Row.FindControl("lblClosed_Total");
string strLbl;
strLbl = lbl.Text;
if (strLbl != "0")
{
e.Row.Cells[3].BackColor = Color.Black;
}
Do I need to use as a label control for "[" text as to change the color? Or is there any other way?
Thanks in advance for any ideas/suggestion.