styling in a gridview

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
 
J

JohnE

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top