Link to home
Start Free TrialLog in
Avatar of skolakanuru
skolakanuru

asked on

GridView, very slow response for javascript

Hello ,
I have a gridview. I used to use it without item templates, so that it renders as a html table in the browser. I have some javascript which can respond to mouseover and mouseout events on a row. It used to work normally until I started using itemtemplates with about 3000 rows in the gridview. now it takes atleast couple of seconds to get the response.

For example, I have a mouseover() event (javascript) on a row where the contents get bold when the mouse is on the row and becomes normal font when mouse leaves that row using mouseout(). Now it is responding very slow.If i move mouse on the grid some of the rows remain bold because mouseout() even won't get fired because of the slow response. I'm wondering if using the ASP controls like lable in itemtemplates causing this( source file is about 2.3MB.)
Any ideas?

Here is the code I'm using

    Private Sub GridView1_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GridView1.RowCreated, GridView2.RowCreated
            e.Row.Attributes.Add("onmouseover", "this.style.cursor='hand';this.className = 'mouseover';")
            e.Row.Attributes.Add("onmouseout", "MouseOut()")
            e.Row.Attributes.Add("onclick", "SelectRow(this)")
            e.Row.Attributes.Add("title", "Click to toggle the selection of this row")
        End If

select row function would just change the backgroundcolor of the row when user selects a row.

Thanks,

    End Sub


SOLUTION
Avatar of Lolly-Ink
Lolly-Ink
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of skolakanuru
skolakanuru

ASKER

Hello,

I have no problem with populating the gridview. My problem is, my javascript events are responding very slow. Be
I have about 4000 records in the gridview.

 As I said, I just want to make the font bold when we hover mouse on a particular row and make it normal when mouse leaves the row. due to slow response, some of the rows are staying bold even after mouse leves the row.

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial