views:

95

answers:

2

I'm using tablesorter in an asp:GridView and works fine but this been bother me for some time

Every time there is a button action (firing up a call to the server, refreshing the page), table sorter loses the headers as you can see by the 2 images below:

before refresh:

alt text

after refresh:

alt text

Does anyone have an idea of if this might be a bug, or something on my end just for the behavior of it? Maybe someone already crossed this problem before

A: 

I see you're using Rad Controls, which most likely is using ajax on postback. When the dom rebuilds, your jQuery tablesorter plugin loses it's binding on those recreated elements.

More about it here: http://stackoverflow.com/questions/718307/jquery-tablesorter-ajax-div-content-update-problem

NATO24
I just kept the id's, I'm using a normal GridView now, as I state in the question (first line), as Rad controls I had much more trouble and took forever to render.
balexandre
+1  A: 

One solution is to specify a custom header, and then put a conditional in your:

OnRowCreated

Event checking to see if you're currently processing the header row, and if so, populate with your custom header. This gets around the loss of the auto created headers.

JTrott
will give this a shot, thanks for the idea.
balexandre
cool be sure to let me know how it works out for you!
JTrott
How did this work out for you bale?
JTrott