RDiehl Posted February 25, 2008 Report Posted February 25, 2008 I'm looking for something at page load/data bound that sets text or background color in a target column based on the value in another column. In one post I saw a suggestion on iterating items 'on data bound' to apply format but I need something more specfic.
AngelR Posted February 25, 2008 Report Posted February 25, 2008 Try a different event, like Grid Rendering: protected void Grid1_Rendering(object sender, EventArgs e) { try { Color RedColor = Color.Red; Color BlueColor = Color.Blue; foreach (GridItem Item in Grid1.Items) { if (Convert.ToDouble(Item.Cells[0].Text) < 5) { Item.Style.BackColor = RedColor; } else { Item.Style.BackColor = BlueColor; } } } finally { } } Let me know if this helps.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.