Datagrid in ViewState

Discussion in 'ASP .Net Datagrid Control' started by igitur, Jul 13, 2004.

  1. igitur

    igitur Guest

    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!
     
    igitur, Jul 13, 2004
    #1
    1. Advertising

  2. 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

    "igitur" <> wrote in message
    news:...
    > 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!
     
    Eliyahu Goldin, Jul 13, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Rush
    Replies:
    2
    Views:
    542
    Ben Rush
    Dec 5, 2003
  2. Steph
    Replies:
    2
    Views:
    1,682
    heislord5
    May 11, 2011
  3. ujjc001
    Replies:
    0
    Views:
    1,385
    ujjc001
    Jul 27, 2005
  4. sck10
    Replies:
    6
    Views:
    930
    sck10
    Sep 1, 2006
  5. mark

    Viewstate errors... how do I get viewstate working?

    mark, Feb 20, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    293
Loading...

Share This Page