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