Hi
I have the following code in Page Load event to show overdue lines in a GridView with date in red...
for (int i = 0; i < GridView1.Rows.Count; i++)
{
if (Convert.ToDateTime(GridView1.Rows.Cells[7].Text)<= DateTime.Now)
{
GridView1.Rows.Cells[7].ForeColor = System.Drawing.Color.Red;
}
}
It works fine for the first display of the page, but the dates are not shown in red on subsequent displays (when item is edited etc) although the debugger shows the code is still executing as expected. Its not inside if !IsPostback.
What did I miss?
Thanks
I have the following code in Page Load event to show overdue lines in a GridView with date in red...
for (int i = 0; i < GridView1.Rows.Count; i++)
{
if (Convert.ToDateTime(GridView1.Rows.Cells[7].Text)<= DateTime.Now)
{
GridView1.Rows.Cells[7].ForeColor = System.Drawing.Color.Red;
}
}
It works fine for the first display of the page, but the dates are not shown in red on subsequent displays (when item is edited etc) although the debugger shows the code is still executing as expected. Its not inside if !IsPostback.
What did I miss?
Thanks