asp.net gridview is fetching data too long
Question
it seems common issue so I am surprised I didn't find solution already, maybe someone can help me out. I have a gridview that displays list of users of the app, this list is very big, and takes forever to load the data. Otherwise, data is paged through and once loaded everything goes fine. To help admins, I made search box and that works well. Only issue is initial load of data, it seems that asp.net is retrieving all the records initially.
Is there a way to get only records for current page. Maybe there is a setting for gridview that I am missing or I am doing something else wrong.
Thank you in advance for suggestions.
Zeljko
Solution
you're going to have to do your own custom paging. Depending on your datasource you have to pass the PageIndex and size, to only get the pages results to be returned.
Ive used this run through before: http://aspnet.4guysfromrolla.com/articles/031506-1.aspx
OTHER TIPS
Sounds like maybe you're using a Datatable/Dataset when you really want a Datareader. Alternatively, maybe I'm not understanding what you mean by "initial" and what you're experiencing is that you hit the jit compiler every time you do a new deployment.