styling in a gridview

  • Thread starter Thread starter JohnE
  • Start date Start date
J

JohnE

I have a gridview that has a column that changes color onmouseover. But, I
need to have the row return back to the original color in the onmouseout.
The rows alternate backgroundcolor. Here is the code (_RowDataBound) that is
currently in play;

e.Row.Cells[4].Attributes.Add("onmouseover",
"this.style.cursor='pointer'; this.style.backgroundColor='Gainsboro';
this.style.color='blue'");
e.Row.Cells[4].Attributes.Add("onmouseout",
"this.style.color='black'");

I just added the Gainsboro background color then found out what I had in the
onmouseout was for only every other row cell that had that color.

What can I use to have the cell return back to the original color?

Thanks...John
 
I think I found the answer, by accident. I added the following at the end of
the onmouseout;

this.style.backgroundColor=' '

and inadvertly forgot to add anything between the single quotes when I ran
it. The original cell color returns.

If this is the wrong way, please let me know.

Thanks...John
 
Back
Top