I have a datagrid that is displaying data that is being returned from a stored procedure. That works fine. The problem is that I want to do sorting. I know that there is sorting functionality in the grid, however, I don’t want to go back to the server and get a new set of data. What I want to do is just re-sort the data that is already being displayed.
Anyone have any ideas on how that is done?
Thanks!
UPDATE
Basically, I couldn’t not find an easy solution to this issue. I tried updating my dataGrid to a gridView control and even that (for my particular issue) was difficult. I wound up un-doing all the changes and just adding another grid that had just the data I wanted for the requirement.
If anyone else has an issue like this I would recommend taking it out of a datagrid and writing it in jQuery. I could of written a table that had the data I wanted (and fully sortable using a plug-in mentioned below) in 15 minutes compared to the hours I spent trying to jam a square peg into a round hole.
One thing you can do is save the current result set into the users session, provided it isn’t that large. You can then use the build in sorting capabilities of the DataGrid without dealing with a round trip to the database.
You will make a trip back to the server, but often the trip to the web server and back is far faster than the trip that involves the database.