PageCount too high for Items.Count

K

Keith Patrick

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)?
 
K

Keith Patrick

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.
 

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,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top