Q:

Set Background color of GridView Row during page postback

I have a grid with few rows. On satisying a certain condition, I need to change the background color of the row that satifies that condition. I do this in the rowdatabound event of the grid, but then it loses the color during the page postback. How do I fix this issue?
My code is like so.
If (e.Row.RowType = DataControlRowType.DataRow) Then
    Dim lblShowBreak As System.Web.UI.WebControls.Label = e.row.FindControl("lblShowBreak")
    Dim lblIsBreak As System.Web.UI.WebControls.Label = e.row.FindControl("lblIsBreak")

    If Trim(lblIsBreak.Text) = "Y" Then
       e.Row.BackColor = System.Drawing.Color.Black
    End If
End If

A:

I have resolved this..my fix is as follows.
If Trim(lblIsBreak.Text) = "Y" Then
   lblShowBreak.Visible = True
   For i = 0 To gvTimeTable.Columns.Count - 1
       e.Row.Cells(i).BackColor = System.Drawing.Color.LightGray
   Next
End If

