Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing Gridview row background color when editing?

I'm having some trouble with editing a gridview row's background color when Editing it.

The thing is, I am using the RowDataBound event method to change e.Row.BackColor based on a criteria when displaying the report( 3 different colors depending on result ). For the rows that don't fall under that criteria, a GridView's property <EditRowStyle BackColor="#999999" /> is applied upon clicking the Edit button.

However, I can't seem to find a way to change the color of those that do fall under the criteria since RowDataBound seems to be called all the time, overriding any changes I make.

Any suggestions?

like image 322
Eton B. Avatar asked Dec 07 '22 01:12

Eton B.


1 Answers

write a single line in Grid RowEditing Event:

GridView1.EditRowStyle.BackColor = System.Drawing.Color.LightYellow; 
like image 119
Mian Fida Avatar answered Dec 09 '22 15:12

Mian Fida