Since we upgraded from Infragistics 2008.2 to Infragistics 2009.2 a problem has arised. Basically I want to save an UltraWebGrid in a session variable to keep its state as I move down in the page hierarchy and back. I save the grid, then read from the session variable to check that it has been saved correctly. And it has. I have an UltraWebGrid with the correct amount of rows and everything seems to be ok. I then do a Response.Redirect to another page, and in page load of the new page I read the same session variable again. And by then the UltraWebGrid has lost all its rows (and bands). Note that the session variable is not null, reading from it and casting it to an UltraWebGrid goes fine. But all rows are gone.
In the 2008.2 days I think we stored a RowsCollection in the session variable instead of an entire UltraWebGrid, but with 2009.2 the same thing happens there. Information is lost when moving between pages.
Any ideas?
Pablo Orlando M. Huezo said:... because it will take a lot of resources ...
To expand upon this statement - storing WebGrid in Session state will almost certainly require more resources than storing the data source. Storing WebGrid (or any of its parts) in a Session variable is very much an approach we have always recommended against using whenever it came up. With the changes I mentioned earlier in this thread, it's no longer possible. The same results (minus the memory concerns) can still be accomplished without directly storing the grid in session.
Hi, I read your post and looks fine.
But you should be aware of storing a datasource into a session variable, unless you have a powerful server that support the client requests for you pages, because it will take a lot of resources, maybe, only if fits, you can get around this by storing an array instead a datasource, converting by looping thought and passing it to an array, and then storing the array into the session variable.
As I say, this is only a sugestion.
Alright, I finally worked it out with saving the datasource in sessions instead. Not a very bug to get from a component update though.
elwolfo said:I want to save an UltraWebGrid in a session variable to keep its state
elwolfo said:And by then the UltraWebGrid has lost all its rows (and bands).
elwolfo said:Any ideas?
If you need state-related information (such as expanded rows), you'll need to devise your own mechanism for persisting and reapplying that state.
If I were storing row expansion information in session, for example: I'd store the DataKey of each row that was expanded at the root band (in case the row moves to a different location due to sorting or to changed data). Underneath each of those entries, I'd also store the DataKey of any child rows that are expanded, and so on. For this type of approach, I'd likely store my data as an XML string in session, to take advantage of its hierarchical nature. Whatever means you use to store the data, you can read it in the InitiializeRow event of the grid, expanding any rows that match your criteria. For actually updating this information to track what's expanded and what's collapsed, you'd probably use a combination of client-side and server-side events.