change GridView cell color on mouseout

Murray Brown
Murray Brown used Ask the Experts™
In my GridView I previously used the following code to make cells clickable.
How can I use similar code to  change the cells color on mouseout

    Private Sub GridView1_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GridView1.RowCreated

        If e.Row.RowType = DataControlRowType.DataRow Then
            'Following link shows how cells are made clickable
            For i As Integer = 0 To e.Row.Cells.Count - 1
                Dim cell As TableCell = e.Row.Cells(i)
                cell.Attributes("onmouseover") = "'pointer';'underline';"
                cell.Attributes("onmouseout") = "'none';"
                'cell.ToolTip = "You can click this cell"
                cell.Attributes("onclick") = String.Format("document.getElementById('{0}').value = {1}; {2}", SelectedGridCellIndex.ClientID, i, Page.ClientScript.GetPostBackClientHyperlink(CType(sender, GridView), String.Format("Select${0}", e.Row.RowIndex)))
        End If

    End Sub

Open in new window

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Developer User Interface
cell.Attributes("onmouseover") = "'pointer';'underline';'red';"
cell.Attributes("onmouseout") = "'none';''"

Open in new window

Murray Developer


Great. Thanks very much

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial