HTML:
<asp:GridView ID="Gv" runat="server" AutoGenerateColumns="False"
CellPadding="1" OnRowDataBound="Gv_RowDataBound">
<Columns>
<asp:BoundField DataField="MES_ANIO" HeaderText="MES">
<ItemStyle Width="80px" CssClass="tdIzq" />
</asp:BoundField>
<asp:BoundField DataField="PERIODO" HeaderText="PERIODO">
<ItemStyle Width="80px" CssClass="td" />
</asp:BoundField>
<asp:HyperLinkField DataNavigateUrlFields="CVE_USUARIO" HeaderText="USUARIO" DataNavigateUrlFormatString="/Ventas/RepArchivoPersonalAuxiliarEmp.aspx?prospecto={0}"
DataTextField="USUARIO">
<ItemStyle Width="180px" CssClass="tdUsuario" />
</asp:HyperLinkField>
</Columns>
</asp:GridView>
Code Behind:
protected void Gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow) {
e.Row.Attributes.Add("onMouseOver", "this.originalstyle=this.style.backgroundColor;this.style.backgroundColor='#f1f3f5';this.style.cursor='pointer';");
e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor=this.originalstyle;");
}
}