Gridview row count troubles

  • Thread starter Thread starter SAL
  • Start date Start date
S

SAL

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
 
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 ([email protected], 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.
 
Back
Top