When i set EnableViewState to false, grouping and the ability to move columns don't seem to work. Is that to be expected or am i doing something wrong?
If it is to be expected then, is there a way to turn ViewState off and still keep the grouping and column moving functionality?
Any help will be appreciated, Thanks
Hawi
Hello Hawi,
Thanks for writing. Yes, I believe this is the expected behaviour - after postback the grid will not be able to "remember" its state if ViewState is disabled. This is due to the stateless nature of HTTP, the ViewState is simply a "hack" around it to deal with these types of situations.
While I do not recommend switching ViewState off completely, I can suggest one technique that will move the storage medium for ViewState from the HTML (in hidden) to the Server. This way, the page you serve to your clients will be much smaller, yet you will be able to have all the benefits ViewState has.
Here is a great blog post by Scott Hansleman on this topic
http://www.hanselman.com/blog/MovingViewStateToTheSessionObjectAndMoreWrongheadedness.aspx
Hope this helps.
Thanks for the response Rumen.
I just read the blog, all i get is is sarcasm from that blog. I'm not sure i understand what he is recommending.
Do you have any suggestions?