Thursday, March 17, 2011

VB.NET OnmouseOver GridView Rowcolor Change [With RowdataBound]

 //Open GridView RowDataBound Property

If e.Row.RowType = DataControlRowType.DataRow Then

            e.Row.Attributes.Add("onmouseover", "this.style.cursor='pointer';this.style.backgroundColor='orangered'")
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white'")
            e.Row.Attributes.Add("onclick", "window.open('Default3.aspx');")

        End If

//write on source code

  <asp:GridView ID="GridView2" OnRowDataBound="GridView2_RowDataBound" runat="server">

No comments: