424,306 Members | 1,035 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,306 IT Pros & Developers. It's quick & easy.

Mouseover/Mouseout for Gridview cells

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.