Gridview row count troubles

Discussion in 'ASP .Net' started by SAL, Oct 15, 2007.

  1. SAL

    SAL Guest

    Hello,
    I have a small Web app that has a couple of pages in it. Both pages have
    gridviews on them with basically the same ObjectDataSource. This object data
    source is a business class. One of the GridViews allows editing so I enable
    ViewState on that one. The other one does not so I disable ViewState on that
    one.
    The problem is that the one with the ViewState disabled is reporting correct
    row numbers while the other one does not.
    I can perform the same filtering on the gridview with view state disabled
    over and over again and I get the same row count each time. However, I have
    to perform the same filtering twice on the one with view state enabled to
    get the correct row count (only the 2nd time)...
    How can I make the one with view state enabled report the correct row count
    each time?


    SAL
     
    SAL, Oct 15, 2007
    #1
    1. Advertising

  2. Hi SAL,

    Could you please post some code? Based on my understanding so far, such
    issue is probably caused by when do you change the row filter and when do
    you read the row count. The order matters since some events are occurred in
    different stage in a page's life cycle:

    #ASP.NET Page Life Cycle Overview
    http://msdn2.microsoft.com/en-us/library/ms178472.aspx



    Regards,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Oct 16, 2007
    #2
    1. Advertising

  3. SAL

    SAL Guest

    Thanks Walter, I got it working now...

    SAL

    ""Walter Wang [MSFT]"" <> wrote in message
    news:...
    > Hi SAL,
    >
    > Could you please post some code? Based on my understanding so far, such
    > issue is probably caused by when do you change the row filter and when do
    > you read the row count. The order matters since some events are occurred
    > in
    > different stage in a page's life cycle:
    >
    > #ASP.NET Page Life Cycle Overview
    > http://msdn2.microsoft.com/en-us/library/ms178472.aspx
    >
    >
    >
    > Regards,
    > Walter Wang (, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
     
    SAL, Oct 16, 2007
    #3
    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. H5N1
    Replies:
    0
    Views:
    2,739
  2. Replies:
    5
    Views:
    678
  3. DaveyP

    gridview, paging and row count

    DaveyP, Jun 15, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    894
    DaveyP
    Jun 15, 2007
  4. D
    Replies:
    0
    Views:
    229
  5. J055

    row count in inherited GridView control

    J055, Mar 29, 2006, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    385
    Steven Cheng[MSFT]
    Apr 3, 2006
Loading...

Share This Page