Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. <style type="text/css">
  2. .row-highlight
  3. {
  4. background-color: Yellow;
  5. }
  6. .row-select
  7. {
  8. background-color: red;
  9. }
  10. </style>
  11.  
  12. <asp:GridView ID="GridView1" runat="server">
  13.  
  14. </asp:GridView>
  15. <script type="text/javascript">
  16. $(function () {
  17. var tr = $('#<%= GridView1.ClientID %>').find('tr');
  18.  
  19. tr.hover(
  20. function () { // mouseover
  21. $(this).addClass('row-highlight');
  22. },
  23. function () { // mouseout
  24. $(this).removeClass('row-highlight');
  25. }
  26. );
  27. tr.click(function() {
  28. $(this).addClass('row-select');
  29. });
  30. });
  31.  
  32. </script>
  33.  
  34. <asp:GridView ID="GridTest" runat="server" DataSourceID=... >
  35. <Columns>
  36. ...
  37. </Columns>
  38. <SelectedRowStyle BackColor="#E2DED6"/>
  39. </asp:GridView>
  40.  
  41. <asp:GridView id="GridView1" runat="Server">
  42.  
  43. <Columns></Columns>
  44.  
  45. <SelectedRowStyle CssClass="selectedRowStyle" BackColor="LightCyan"
  46. ForeColor="DarkBlue"
  47. Font-Bold="true" />
  48.  
  49. </asp:GridView>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement