Results 1 to 6 of 6

Thread: [2005] GridView Postback and Attributes

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2007
    Posts
    43

    [2005] GridView Postback and Attributes

    Hi all,

    I was hoping someone would give me a hand with an interesting issue i have run into.

    Basically I have a bit of code as follows

    Code:
    Private Sub GridView_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView.RowDataBound
            If e.Row.RowType = DataControlRowType.DataRow Then
                e.Row.Attributes.Add("OnMouseOver", "return ChangeMyGridView('" & e.Row.ClientID & "');")
                e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='Transparent'")
            End If
    End Sub
    Pretty self explanatory. However after a postback the mouseover and mouseout javascript events no longer work for the GridRows.

    Now some of you will say that this is likely because my binding is occurring under a if Not IsPostBack condition and you would be correct.

    However the actual syntax for the OnMouseOut and OnMouseOver events in the HTML table row IS THERE after the postback so I am quite confused….

    Any Ideas?
    Last edited by maximg; Jan 6th, 2009 at 07:54 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width