Highlighting row in Gridview using Onmouseover

M

MasterChief

I am trying to get it so when I go over a row in a gridview it will
highlight the row. I have looked at some examples but can't get it to
work.

Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal
e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles
GridView1.RowDataBound
If (e.Row.RowType = DataControlRowType.DataRow) Then
e.Row.Attributes.Add("onmouseover",
"this.style.backgroundcolor='blue'")
e.Row.Attributes.Add("onmouseout",
"this.style.backgroundcolor='white'")
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,348
Messages
2,571,451
Members
48,795
Latest member
Lonell Lee

Latest Threads

Top