StateView

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using the datagrid with 100-200 column to show data
This data is also stored in the ViewState for postback
However the viewstate part is large
I assumend that using SQLServer for ViewState (instead of InProc) at least removes most of viewstate in the page which makes to HTML page must smaller, but it doesn'
Does somebody knows how to solve this, without rebinding the data after post back

thx
 
I agree with your approach of storing the data in an SQL Server, and
disable viewstate on the datagrid. You will have to rebind the data
after every postback because you are not using the ViewState. There
is no way around this. When using the viewstate, ASP.NET rebinds the
data from the viewstate to the grid on each postback behind the scene
anyways. You can improve the speed by saving the user's results to a
file on the application server. When the user request for the next
section of data, you can just return the data from the file.

Besides using SQL Server and file, I think you will need to redesign
your datagrid to have less columns. 100-200 columns is too much data
to put on a single grid. It will still be very slow even with the
data on the SQL server and file. You could reduce the columns or
break it up into multiple pages. I found that 10 columns is probably
the limit because anything greater than that will make the datagrid
too big, and will require the user to scroll to view all the data.

I found that most of the feature of the DataGrid becomes impractical
when there are large amounts of data. It is because it generates a
huge viewstate that will take a long time for the page to be
downloaded on a 56K connection. The DataGrid does provide an object
model that is very easy to work with, but I think the price to pay is
too high. I still perfer using a simple table because you have more
control on the size and behavior of the grid. For example, it is a
lot more difficult to make a datagrid scroll vertically with the
header being fixed.

Tommy,
 
Back
Top