Add "OnRowCreated" event to the GridView:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="CustomerID" DataSourceID="SqlDataSource1" AllowPaging="True" AllowSorting="True" OnRowCreated="GridView1_RowCreated"> ... </asp:GridView>
The event code:
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { e.Row.Attributes.Add("onMouseOver", "this.style.background='#eeff00'"); e.Row.Attributes.Add("onMouseOut", "this.style.background='#ffffff'"); }
No comments:
Post a Comment