469,117 Members | 1,296 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,117 developers. It's quick & easy.

Mouseover/Mouseout for Gridview cells

How does one set a Mouseover/Mouseout event on a cell in a GridView? I can
successfully assign these events to be active on a row in a GridView.

I can do this with a DataGrid, by adding code to the OnItemBoundDataGrid event
Mar 11 '06 #1
2 14438
Sub CustomersGridView_RowDataBound(ByVal sender As Object, ByVal e As
GridViewRowEventArgs)

If e.Row.RowType = DataControlRowType.DataRow Then
'change the hover effect over the first cell in the row

e.Row.Cells(1).Attributes.Add("onmouseover","this. className='something'")

e.Row.Cells(1).Attributes.Add("onmouseout","this.c lassName='somethingelse'")

End If

End Sub

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Matt Colegrove" wrote:
How does one set a Mouseover/Mouseout event on a cell in a GridView? I can
successfully assign these events to be active on a row in a GridView.

I can do this with a DataGrid, by adding code to the OnItemBoundDataGrid event

Mar 11 '06 #2
That's exactly what I was looking for. Thanks!!

"Phillip Williams" wrote:
Sub CustomersGridView_RowDataBound(ByVal sender As Object, ByVal e As
GridViewRowEventArgs)

If e.Row.RowType = DataControlRowType.DataRow Then
'change the hover effect over the first cell in the row

e.Row.Cells(1).Attributes.Add("onmouseover","this. className='something'")

e.Row.Cells(1).Attributes.Add("onmouseout","this.c lassName='somethingelse'")

End If

End Sub

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Matt Colegrove" wrote:
How does one set a Mouseover/Mouseout event on a cell in a GridView? I can
successfully assign these events to be active on a row in a GridView.

I can do this with a DataGrid, by adding code to the OnItemBoundDataGrid event

Mar 12 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Colin Steadman | last post: by
1 post views Thread by Tony Farrell | last post: by
1 post views Thread by johnnydublin | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.