PageCount too high for Items.Count

Discussion in 'ASP .Net Datagrid Control' started by Keith Patrick, Jun 9, 2004.

  1. I have a datagrid control that is working fine as I update, with what I
    assume are correct page counts (pre-filtered, there are probably 100 pages
    of 8 items each), but on my last filtering action, I reduce the item count
    to 8 items. However, the PageCount is always 3. If I click the 3rd page,
    the list empties on postback. PageSize is 8, and Items.Count == 8, but
    PageCount is continually 3. Can someone point me in the right direction as
    to what I may be doing wrong (I can't even describe this problem with the
    right keywords to get a decent Google search)?
     
    Keith Patrick, Jun 9, 2004
    #1
    1. Advertising

  2. Ahhh...found the problem: there aren't 8 items in the list. There are 16
    (Items.Count is returning the count on the current page; VirtualItemCount
    returns 0) + a SelectAll row, which is throwing off the count, so the 3rd
    page is the overflow caused by the SelectAll rows on each page.

    "Keith Patrick" <> wrote in message
    news:...
    > I have a datagrid control that is working fine as I update, with what I
    > assume are correct page counts (pre-filtered, there are probably 100 pages
    > of 8 items each), but on my last filtering action, I reduce the item count
    > to 8 items. However, the PageCount is always 3. If I click the 3rd page,
    > the list empties on postback. PageSize is 8, and Items.Count == 8, but
    > PageCount is continually 3. Can someone point me in the right direction

    as
    > to what I may be doing wrong (I can't even describe this problem with the
    > right keywords to get a decent Google search)?
    >
    >
     
    Keith Patrick, Jun 9, 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. David Potahisnsky

    retrieve PageCount of DataGrid

    David Potahisnsky, Nov 7, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    397
    David Potahisnsky
    Nov 7, 2003
  2. Dave

    Datagrid PageCount Nightmare!!

    Dave, Nov 13, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    1,570
  3. anon
    Replies:
    0
    Views:
    465
  4. George Smith
    Replies:
    2
    Views:
    1,433
    Alvin Bruney [MVP]
    Apr 27, 2007
  5. Franck
    Replies:
    4
    Views:
    9,203
    sangsharma
    Jun 29, 2007
Loading...

Share This Page