Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
400
Custom Sorting Sequence
posted

I would like to be able to sort one column of a WebGrid by a special rule. The column contains season codes, like F05, S05, F06, S06, where the F and S stand for Fall and Spring, and the numbers stand for the year (so F05 means Fall 2005). So the sort should be first on the last two digits, and then on the first letter, where S comes before F. So, for the seasons listed above, the proper order should be (S05,F05,S06,F06).

I would like this special rule to be used whenever they click on the column header for sorting.

What is the best way to do this?