I miss an ordering functionality in the grid so I had to extend it using and extension method of HtmlHelper.
What I want to achieve
When a user comes to my grid, the url could be i.e.
and when the user clicks a link in the header to order the data in the gird then the URL could be changed to
In addition we should be able to inform the user about current ordering (asc,desc) and the user should have possibility to click the link to change the ordering in the header.
In short something like this:
Current MVCContrib doesn’t include such support so I added it.
I made an extension methods which you can you like in the following:
OrerbyLink extension methods have to check the current URL to see what’s the current ordering. It would be nicer if this would be part of some
interface as well as it is done with IPagination.
I think, it would be quite good if IPagination would be renamed to ICollectionModel which could contain both:
1) info about the pagination
2) info about the ordering
3) collection of the data itself
And then it would be good if there would be an easy way who to wrap the custom IEnumarable<T> to ICollectionModel. Propable using an extension method as it’s doen via AsPagination<T>().
The code can be downloaded from here
What do you think?


The download link doesn’t work. Can you please double check that? Thanks.
Comment by Dan Miser — March 7, 2009 @ 1:17 am
Sorry, corrected. I cant upload the zip files to wordpress so I have to upload them to any free reliable storage server.
Frantisek
Comment by Frantisek — March 7, 2009 @ 7:12 am