Changing alternate row color on mouseover

R

raoof ahmed khan

Hi All,
I have a gridview in which i set alternate row color property. Now i want
to set color change on mouse over and reset it back on mouse out. The
problem is that when i mouse out it should take the original color back, for
this i need to know on which row mouse is hovering at present.
Does anybody know how to catch the current row index.

Any help would be appreciated.

Regards.
 
E

Eliyahu Goldin

You don't need to know the row index. In javascript, you can keep references
to the previous row and the previous row style:

var prevRow;
var savedClass;

function selectRow (row)
{
if(prevRow!=null)
{prevRow.className=savedClass};
savedClass=row.className;
row.className='SelectionGridSelectedItem';
prevRow=row;
}


--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 

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

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top