Datagrid in ViewState

I

igitur

Here's a quote out of
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspnet/html/asp11222001.asp

"The DataGrid control is a particularly heavy user of ViewState. By
default, all of the data displayed in the grid is also stored in
ViewState, and that's a wonderful thing when an expensive operation
(like a complex search) is required to fetch the data. However, this
behavior also makes DataGrid the prime suspect for unnecessary
ViewState"

Is this true? I'm pretty sure I have to populate my datagrids every
time.

thnx,
Francois
DIE SPAMMER DIE! Or remove the underscores!
 
E

Eliyahu Goldin

The statement is true. If you disable ViewState, you will see that resulting
HTML is much smaller.

And you are also right. If your datagrid is databound and you don't
re-populate your data source, the datagrid will come out empty.

My guess is that if the columns are not databound and ViewState is enabled,
the data should persist. It might not be correct since I never checked it.

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top