I'm using the item databound event in radgrid to look at a status column and to change another column's font color and set it to bold if the status equals 3. This works perfectly fine on all of the rows except for the last row. Is there anything you can see with this code example that I'm missing to get this to apply to the last row as well?
protected void rgGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
foreach (GridDataItem item in rgGrid.Items)
{
Label sunstat = item["sunstat"].FindControl("lbliSundayStat") as Label;
Label monstat = item["monstat"].FindControl("lbliMondayStat") as Label;
Label tuestat = item["tuestat"].FindControl("lbliTuesdayStat") as Label;
Label wedstat = item["wedstat"].FindControl("lbliSundayStat") as Label;
Label thustat = item["thustat"].FindControl("lbliSundayStat") as Label;
Label fristat = item["fristat"].FindControl("lbliSundayStat") as Label;
Label satstat = item["satstat"].FindControl("lbliSundayStat") as Label;
Label sun = item["Sunday"].FindControl("lbliSunday") as Label;
Label mon = item["Monday"].FindControl("lbliMonday") as Label;
Label tue = item["Tuesday"].FindControl("lbliTuesday") as Label;
Label wed = item["Wednesday"].FindControl("lbliWednesday") as Label;
Label thu = item["Thursday"].FindControl("lbliThursday") as Label;
Label fri = item["Friday"].FindControl("lbliFriday") as Label;
Label sat = item["Saturday"].FindControl("lbliSaturday") as Label;
if (sunstat.Text == "3")
{
sun.ForeColor = Color.Red;
sun.Font.Bold = true;
}
if (monstat.Text == "3")
{
mon.ForeColor = Color.Red;
mon.Font.Bold = true;
}
if (tuestat.Text == "3")
{
tue.ForeColor = Color.Red;
tue.Font.Bold = true;
}
if (wedstat.Text == "3")
{
wed.ForeColor = Color.Red;
wed.Font.Bold = true;
}
if (thustat.Text == "3")
{
thu.ForeColor = Color.Red;
thu.Font.Bold = true;
}
if (fristat.Text == "3")
{
fri.ForeColor = Color.Red;
fri.Font.Bold = true;
}
if (satstat.Text == "3")
{
sat.ForeColor = Color.Red;
sat.Font.Bold = true;
}
}
}
protected void rgGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
foreach (GridDataItem item in rgGrid.Items)
{
Label sunstat = item["sunstat"].FindControl("lbliSundayStat") as Label;
Label monstat = item["monstat"].FindControl("lbliMondayStat") as Label;
Label tuestat = item["tuestat"].FindControl("lbliTuesdayStat") as Label;
Label wedstat = item["wedstat"].FindControl("lbliSundayStat") as Label;
Label thustat = item["thustat"].FindControl("lbliSundayStat") as Label;
Label fristat = item["fristat"].FindControl("lbliSundayStat") as Label;
Label satstat = item["satstat"].FindControl("lbliSundayStat") as Label;
Label sun = item["Sunday"].FindControl("lbliSunday") as Label;
Label mon = item["Monday"].FindControl("lbliMonday") as Label;
Label tue = item["Tuesday"].FindControl("lbliTuesday") as Label;
Label wed = item["Wednesday"].FindControl("lbliWednesday") as Label;
Label thu = item["Thursday"].FindControl("lbliThursday") as Label;
Label fri = item["Friday"].FindControl("lbliFriday") as Label;
Label sat = item["Saturday"].FindControl("lbliSaturday") as Label;
if (sunstat.Text == "3")
{
sun.ForeColor = Color.Red;
sun.Font.Bold = true;
}
if (monstat.Text == "3")
{
mon.ForeColor = Color.Red;
mon.Font.Bold = true;
}
if (tuestat.Text == "3")
{
tue.ForeColor = Color.Red;
tue.Font.Bold = true;
}
if (wedstat.Text == "3")
{
wed.ForeColor = Color.Red;
wed.Font.Bold = true;
}
if (thustat.Text == "3")
{
thu.ForeColor = Color.Red;
thu.Font.Bold = true;
}
if (fristat.Text == "3")
{
fri.ForeColor = Color.Red;
fri.Font.Bold = true;
}
if (satstat.Text == "3")
{
sat.ForeColor = Color.Red;
sat.Font.Bold = true;
}
}
}