wsyeager
Centurion
I have a grid that I databind with a strongly typed dataset which contains thousands of records retrieved from a database. After the dataset is retrieved from the database, I place it in viewstate. I need to do this because of the following:
A user is allowed to check "x" amount of rows on the grid and submit those records (which causes a postback) to the database for updating. At this point, I grab the dataset from viewstate and simply process those records from the appropriate event. The records in the dataset are processed depending on which rows were checked on the grid. The syncing of rows in the grid to the dataset is exactly the same which is expected.
However, based on the dataset being large, this can reduce performance because of the dataset which was placed in viewstate. If I don't place the dataset in viewstate and grab the records from the database again performing the databind, the rows that the user checked will be lost. Even if I somehow save the rows that were checked via viewstate in between postbacks and apply that to the dataset after the databind, the application runs the risk of the rows being out of sync on the datagrid to the dataset, because some other user could have processed those rows. If custom paging is implemented on the grid, I suppose this would reduce the work load on the data in viewstate which defintely would be acceptable. If not using custom paging, this scenario would still exist.
Can somone please shed some light on whether or not my thinking is correct?
How would one deal with this scenario?
A user is allowed to check "x" amount of rows on the grid and submit those records (which causes a postback) to the database for updating. At this point, I grab the dataset from viewstate and simply process those records from the appropriate event. The records in the dataset are processed depending on which rows were checked on the grid. The syncing of rows in the grid to the dataset is exactly the same which is expected.
However, based on the dataset being large, this can reduce performance because of the dataset which was placed in viewstate. If I don't place the dataset in viewstate and grab the records from the database again performing the databind, the rows that the user checked will be lost. Even if I somehow save the rows that were checked via viewstate in between postbacks and apply that to the dataset after the databind, the application runs the risk of the rows being out of sync on the datagrid to the dataset, because some other user could have processed those rows. If custom paging is implemented on the grid, I suppose this would reduce the work load on the data in viewstate which defintely would be acceptable. If not using custom paging, this scenario would still exist.
Can somone please shed some light on whether or not my thinking is correct?
How would one deal with this scenario?