Click here to Skip to main content
16,004,587 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a gridview with some no of cloumns .so when i place mouse on a particular cell
the entire row should be highlighted.below table

empno empname salary designation location
1 srinivas 2000 SE Hyd
2 mahesg 2000 SE Hyd
3 sukar 2000 SE Hyd
4 parkash 2000 SE Hyd
5 sampath 2323 DS Bang


so when i place mouse pointer on "mahesg" entire row should be highligted using JQUERY or when i place mouse pointer on "DS" entire row of that cell should be highlighted.

in asp.net application
Thanks
Srinivas
Posted
Comments
Zoltán Zörgő 5-Jul-12 5:08am    
Any progress?

1 solution

XML
<!DOCTYPE html>
<html>
<head>
<style>
    TABLE.highlight {width: 100%; background-color: #F0F0F0;}
    TD {border: 1px solid green;}
    .light {background-color:red;}
</style>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>

<table class="highlight">
    <tr>
        <td>1</td>
        <td>2</td>
    </tr>
    <tr>
        <td>3</td>
        <td>4</td>
    </tr>
</table>

<script>
  $(function() {
    $(".highlight TD").mouseover(function() {
        $(this).parent().addClass("light");
    }).mouseout(function(){
        $(this).parent().removeClass("light");
    });
  });

</script>

</body>
</html>


... and it has nothing to do with asp.net, you just need the classes and add this script snippet.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900