views:

37

answers:

2

How can I using JQuery sort any column of gridview at client side? Kindly share...

+1  A: 

Check this article may help you :

Sorting Gridview using Jquery with ASP.NET

Sortable GridView using jQuery's TableSorter

Pranay Rana
@Pranay I want to sort the tables at the client side itself without doing any post-back or any communication with the server.
HotTester
@HotTester - as per your question you asked for the gridview control and this article are related to that only
Pranay Rana
@Pranay thanks... i was missing some key points... thanks for ur help
HotTester
+1  A: 

There's the jQuery TableSorter plugin I tend to use for this.

Nick Craver
@Nick would this work with gridview as well ?
HotTester
@HotTester - yep, it's just a table, all you have to do is disable the default ASP.Net sorting, let it render as *just* table.
Nick Craver
Can you share the code for the same... for it is not running the way you are saying... thanks...
HotTester
@HotTester -I'm not following *what* isn't working? All you have to do is call `$("#tableId").tablesorter();` inside a `document.ready` handler, there's no other setup.
Nick Craver
Thanks @Nick ... i got it... actually gridview by default does not render the tbody tag that is needed for the tablesorter. I just added GridView1.UseAccessibleHeader = true; GridView1.HeaderRow.TableSection = TableRowSection.TableHeader; GridView1.FooterRow.TableSection = TableRowSection.TableFooter;
HotTester
and it worked fine for me... thanks for ur help...
HotTester