Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,
i do have a requirement that to sort the grid view. but my gridview has customized headers.
i.e gridview 1row--->Eg:-companyname
gridview 2nd row--->Eg:-details from date to todate and total amount:-xxx
gridview 3rd row--->
s.No empname email phone salary etc...
in order to do above format i have used rowcreated event of gridview and inserting gridview columns dynamically..all working fine. the format which i want to show in gridview has come... but now i need to apply sorting on columns which are from 3rd row.. and i have set autogenerate columns false and there are no bound field or template field to specify sort expression to gridview. i have searched so many posts but didn't get proper answer,,can any one tell me how to do in order to complete my task..
Posted

1 solution

I could not visualize your grid , but I assume from your post that from 3rd row your actual result set starts! One way you can approach sorting is even before populating the grid view.

You can select the rows in sorted order from your data source. If you are storing data in some collections you can implement comparison logic in your class and invoke sort method on the collection object.
 
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