Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style type="text/css">
- .row-highlight
- {
- background-color: Yellow;
- }
- .row-select
- {
- background-color: red;
- }
- </style>
- <asp:GridView ID="GridView1" runat="server">
- </asp:GridView>
- <script type="text/javascript">
- $(function () {
- var tr = $('#<%= GridView1.ClientID %>').find('tr');
- tr.hover(
- function () { // mouseover
- $(this).addClass('row-highlight');
- },
- function () { // mouseout
- $(this).removeClass('row-highlight');
- }
- );
- tr.click(function() {
- $(this).addClass('row-select');
- });
- });
- </script>
- <asp:GridView ID="GridTest" runat="server" DataSourceID=... >
- <Columns>
- ...
- </Columns>
- <SelectedRowStyle BackColor="#E2DED6"/>
- </asp:GridView>
- <asp:GridView id="GridView1" runat="Server">
- <Columns></Columns>
- <SelectedRowStyle CssClass="selectedRowStyle" BackColor="LightCyan"
- ForeColor="DarkBlue"
- Font-Bold="true" />
- </asp:GridView>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement