My application contains hundreds of UltraWebGrids that need to be converted in order to stay current. I am converting the first grids in order to set an example for others to follow. I am finding it difficult to know how to use the properties of EnableAjax, EnableAjaxViewState, EnableDataViewState and EnableViewState. As part of this convertion we would like to speed up our application. I know carrying around ViewState slows things down but I do not see a way around this for an editable grid where we get our data from a SQL datasource. If I turn off EnableDataViewState, I have to bind my data on every post-back and lose the changes the use entered.
Is there suggestions on when to set these values to true or false?
Hello IntegraSys76,
“EnableAjax” property is used to control if the gird will use its own Ajax functionality (the grid is built upon our Ajax Framework - Aikido) and will generate Async Postbacks to the Server or will make full Postbacks to the Server – when property is set to “false”. The second option is useful if for example “UpdatePanel” is used and the grid is in its content template - http://help.infragistics.com/Help/NetAdvantage/ASPNET/2011.2/CLR4.0/html/Infragistics4.Web.v11.2~Infragistics.Web.UI.GridControls.WebDataGrid~EnableAjax.html
“EnableAjaxViewState” property is used to determine if ViewState should be used when control performs Async Postbacks - http://help.infragistics.com/Help/NetAdvantage/ASPNET/2011.2/CLR4.0/html/Infragistics4.Web.v11.2~Infragistics.Web.UI.Framework.Data.FlatDataBoundControl~EnableAjaxViewState.html
“EnableDataViewState” property (when enabled) keeps the grid’s row collection in the ViewState. This allows grid to be bound only on initial load and maintain data between Postbacks without binding to the Data Source - http://help.infragistics.com/Help/NetAdvantage/ASPNET/2011.2/CLR4.0/html/WebDataGrid_Getting_Started_with_WebDataGrid_EnableDataViewState_Property.html
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2011.2/CLR4.0/html/Infragistics4.Web.v11.2~Infragistics.Web.UI.GridControls.WebHierarchicalDataGrid~EnableDataViewState.html
“EnableViewState” property when enabled keeps track of style settings (CSS) and meta-data about the rows. That is the difference with DataViewState which keeps the row data instead.
Separation of the two ViewStates is done for additional improvement of performance – when data are not needed only information about rows is preserved and the size of the ViewState is reduced.
http://community.infragistics.com/aspnet/articles/webdatagrid-dataviewstate-vs-viewstate.aspx
Let me know if you need further information regarding this question.
I am still questioning if it is better to:
#1. Set EnableDataViewState="true" and carrying the grid's data around, only binding the data once.
#2. Set EnableDataViewState="false" and save the grid's data in session and rebind (grid.DataSource=Session DataTable) on every post-back.
When I originally tried #2, I thought the user's changes in the grid would be lost but I see the grid somehow manages this.
Hi Autumn, I know it has been a long time, but did you ever figure this out? I'm struggling with the same issue now.
We ended up with #2. This has worked the best for us for most grids.