<asp:GridView ID="grd" runat="server" Width="99%" EnableViewState="False" AutoGenerateColumns="False" CssClass="grid-view" DataKeyNames="Nt">// some bound filds here <alternatingrowstyle backcolor="#FFB6C1" /> <rowstyle backcolor="White" forecolor="Black" font-names="Verdana" />
.grid-view tr.normal:hover { background-color: Green; } .grid-view tr.alternate:hover { background-color: Green; }
CssClass
RowStyle
AlternatingRowStyle
<AlternatingRowStyle BackColor="#FFB6C1" CssClass="alternate" /> <RowStyle BackColor="White" ForeColor="Black" Font-Names="Verdana" CssClass="normal" />
$(document).ready(function() { $("#<%=grd.ClientID %> tr:has(td)").hover(function() { $(this).css({ "background-color": "Green", "cursor": "pointer" }); }, function() { $(this).css("background-color", "White"); }); });
<style type="text/css"> #GridView1 tr.rowHover:hover { background-color: Yellow; font-family: Arial; } </style> <asp:GridView ID="GridView1" runat="server" EnableViewState="false" RowStyle-CssClass="rowHover" ClientIDMode="Static" />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)