Too many rows in a gridview?
am 02.04.2008 14:43:54 von jhcorey
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.
Re: Too many rows in a gridview?
am 02.04.2008 16:04:49 von The other Mike
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
"cowznofsky" wrote in message
news:78822a46-d4b2-4abf-8478-bb32f00a2995@t54g2000hsg.google groups.com...
>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.