Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Changing alternate row color on mouseover (http://www.velocityreviews.com/forums/t614740-changing-alternate-row-color-on-mouseover.html)

raoof ahmed khan 05-14-2008 06:33 AM

Changing alternate row color on mouseover
 
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.

Eliyahu Goldin 05-14-2008 08:53 AM

Re: Changing alternate row color on mouseover
 
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


"raoof ahmed khan" <raoof ahmed khan@discussions.microsoft.com> wrote in
message news:B1C9FFF1-8C8C-4E23-B41B-225C745EEAFF@microsoft.com...
> 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.





All times are GMT. The time now is 04:16 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.