Too many rows in a gridview?

C

cowznofsky

I have a gridview which I load with about 50 rows of high-level data,
and include a link on each row which will drill down and reload the
gridview. I have some buttons on the page which provide some other
functionality, such as exporting the contents of the gridview to excel
(using my own code).

This typically works fine, but now I find that if I have a high number
of rows of the low-level data, say about 5000, then the page does not
work correctly.

If I hit the button to send he results to excel, the page_load event
is not reached, and I get the generic "The page cannot be displayed".
Hitting a different button raises a popup box with the message
"response text had 0 length".

I assume that I've exceeded some maximum for the viewstate.
 
P

PJ6

I believe you can disable the grid's viewstate provided you don't allow
editing. That's only a quick fix though since you should never display 5K
rows all at once. Use the grid's built-in paging functionality, unless
you're using a separate application server to get the data. In that case you
may want to build paging into the web service or query itself.

Paul
 

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,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top