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
120
Override Sorting
posted

Hello there

I am trying to override the WebGrid Sorting. Is this possible? I am using the method SortColumn and my code is working, but it seems that the default sorting of the webgrid is also running, as it re-sorts my results.

I am passing the SortOrder as a variable through the session to my stored procedure. This has to be so in my case, as my Stored Procedure uses "Row_Number Over" function in SQL Server 2005 and hence I need to pass the sort column seperately.

Can I turn off the WebGrid sorting without disabling sorting altogether? What is the best solution for writing my own sorting code?