What best practice or strategy would you use to enable bulk insert/update in an asp.net gridview control with paging enabled?
Say for e.g. you have about 10000 records and this data gets populated when the page loads and this happens in chunks of say 100 records per webservice request.
To enable editing on these rows what approach would you follow.
Just to give an example say the object model for the fictitious scenario is given below.
List customers; // list of customers
customers = ServiceFacade.GetAllCustomers(pageSize, currentPage);
Assume the above service calls brings back 50 records based on the pageSize displaying 10 records per page.
This will be bound to the gridView as below.
gridCustomers.DataSource = customers; gridCustomers.DataBind();
Some points I would think of is outlined below and requires experts inputs...
- Disable viewstate for gridview (as this will slow down the performance of the page).
- Use session object to persist the change (OR what would you recommend. Is two way binding really helpful here, I don't know as I haven't tried it.)
Your ideas/suggestions are greatly appreciated. I understand I could be flamed for this, but I think the good old DataSet may be useful here (as it has all the essential information which enables tracking changes etc).