asp.net - Set Background color of GridView Row during page postback -


i have grid few rows. on satisying condition, need change background color of row satifies condition. in rowdatabound event of grid, loses color during page postback. how fix issue? code so.

if (e.row.rowtype = datacontrolrowtype.datarow)     dim lblshowbreak system.web.ui.webcontrols.label = e.row.findcontrol("lblshowbreak")     dim lblisbreak system.web.ui.webcontrols.label = e.row.findcontrol("lblisbreak")      if trim(lblisbreak.text) = "y"        e.row.backcolor = system.drawing.color.black     end if end if 

i think, can mark e.row.backcolor = system.drawing.color.black in onprerender method every time. in case state saved always.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -