Click here to Skip to main content
15,886,720 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i sort my GridView ASC or DESC and i click on Next OR Last Page in GridView on that Page the GridView is Not Sorted Because i Rebind My GridView on Page Index Change.

Is there any way that my Grid is Sorted too on Page Index Change.
Thanx in Advance.
Posted

 
Share this answer
 
What you think about sorting the DataSouce i.e., datatable directly. If you'll sort the datasource directly then after rebinding the GridView also you'll be having sorted data. You can perform the sorting on datasource(i.e., your datatable) using linq as well as calling the Sort() function of DataTable.
See the similar discussion below:
How To Sort Datatable in c#.net[^]


--Amit
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900