I'm trying to highlight a specific row in a datagrid who's contition matches
..text = "Dawn"
i've been playing with the code below without much luck, is there a foreach
loop i could do, like
(
foreach(datarows in datagrid)
check if the first cell in the row contains Dawn
if so highlight the row.
)
=== Code i've been playing with ===
for(int x=0;x<=dgQnARooms.Items.Count -1;x++)
{
if(dgQnARooms.Items[x].Cells[0].Text == "Dawn")
{
dgQnARooms.ItemStyle.BackColor = System.Drawing.Color.Cornsilk;
}
}