Changing alternate row color on mouseover

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?cmFvb2YgYWhtZWQga2hhbg==?=

    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

    #2
    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!=nul l)
    {prevRow.classN ame=savedClass} ;
    savedClass=row. className;
    row.className=' SelectionGridSe lectedItem';
    prevRow=row;
    }


    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]




    "raoof ahmed khan" <raoof ahmed khan@discussion s.microsoft.comwrote in
    message news:B1C9FFF1-8C8C-4E23-B41B-225C745EEAFF@mi crosoft.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.

    Comment

    Working...