Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable Viewstate with editable datagrid

Status
Not open for further replies.

sheykc

Programmer
Sep 28, 2001
79
0
0
US
Ok, here is a tough one. My client has a page that needs to run significantly faster when it postbacks to the server. This page uses an editable datagrid, like a spreadsheet, that can have 0 rows to 1000+ rows. They don't want paging, so that's not an option. I'm also using VS 2003.

I have finally realized the problem is the viewstate. If I turn the viewstate off for the grid, and communicate with the server, everything flies by. The file size is now 1.5 megs. But with 500 rows of data and viewstate turned on it uses 3.5 megs.

How can I disable viewstate and still be able to pass the changes that were made on the datagrid, to the server so I can updated the database?

Has anyone accomplished this?
 
No,

I've had the same problem, large datagrids take a long time to post back. The solution had always in my case been to make them filter the data before displaying the datagrid. In general those huge lists are too difficult to edit and work with online. For me, the slow postback has been a warning that something is wrong with my design.

Another option might be to go the "old fashioned" way and build dynamic links that post the changes back in the querystring or form data. But that sounds too much like Classic ASP for my taste, lol.

If the users really need to see all the data at once, perhaps they can edit Excel files that they'll then upload and you'll parse out.

Good luck, hth,
FD
 
They don't want paging, so that's not an option.
They have two options with the current setup:

1) Use paging and have a faster response time
2) Don't use paging and have a slow response time

Another option would be to look into AJAX and only postback the relevant information.





____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Another option to add to ca8msm's. How about limiting the number of rows returned. There really is no need to return 1000+ rows. The user will not be able to handel viewing and editing so many rows.

Jim
 
How about limiting the number of rows returned. There really is no need to return 1000+ rows.

Ha!! You don't know my client. They are working on a pricing contract and they want to be able to view the entire contract on one page. Basically because if they need to work with Item #500, they can just scroll down and find that item.

Plus the business people say that it would confuse the users if we forced them to use paging. It's not what they are used to.

One of the guys I work with suggested Ajax. I know nothing about it, not even where to start. Any good suggestions on that?
 
Well I feel sorry for you having to deal with a client like that.. but I gues we all do from time to time. :)

I have not used AJAX yet, and I am not sure how it would help you on an inital page load anyway. Perhaps someone else who has used it or knows more about can help you with that.

Good Luck... :)

jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top