Changing alternate row color on mouseover

  • Thread starter Thread starter raoof ahmed khan
  • Start date Start date
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.
 
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
 
Back
Top