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
498
Impact of ViewState
posted

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

Parents
  • 28464
    posted

    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. 

Reply Children