Ok,
This seems like it should be simple, but everytime I access the label,
it's text property is always set to "". Here is the code I am using:
private void dgrComputer_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e) {
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem) {
Label lbl = (Label)e.Item.FindControl("lblStatus");
if (lbl.Text == "True") {
e.Item.BackColor = Color.Green;
}
else {
e.Item.BackColor = Color.Red;
}
}
}
I am trying to do conditional processing to change the background color
of the row, I can access the label, but its text property is always set
to "". I have also tried accessing it by using
e.Item.Cells[0].FindControl and a multitude of other different ways but
always with the same results. Does anyone have ideas? this is driving
me up the wall.
thank you
Sean