I really do not get it.
I've worked more with the ASP.NET MVC Framework but less with WebForms.
I have googled alot about how to sort on GridView but mostly it ends up using the Session or the ViewState which I do not prefer.
Instead, this how-to explains how it should work but it does not work for me.
It ends up that
- after clicking on a column name and doing the postback the gridview stays in the same sorting as before.
- GridViewSortEventArgs.SortDirection is always "Ascending" (there are also some threads about that behavior)
Do you have any idea how it could/should work as explained in the how-to mentioned above and without using Session/ViewState? Or maybe the how-to is just not working at all?
Kind regards
Update 1:
The question is more general and also related to the how-to, not to my implementation.
My implementation is not different than in the how-to.
Some more things to mention:
- I am forced to use the ASP.NET 3.5 framework
- In my implementation, I have created a simple GridView in a user control (.ascx file) which contains that logic in code-behind and then loaded that user control on a simple, empty page (.aspx file).
Maybe can anyone confirm if the how-to works for him?