Click to See Complete Forum and Search --> : Keeping viewstate of dynamic datagrid


thomzon
09-08-2005, 12:00 PM
Hi, I have a semi-dynamic datagrid where I need to keep the selections even after postback.
The reason why I call it semi-dynamic is because the Datagrid itself is created in the design view of Visual Studio but there only supplied with a column for selection.
The other columns are added dynamically in the codebehind.

The problem is that when I submit the form at the moment the page does keep the selections - but only that column. The other column is not build as the new databind on postback would cause the whole datagrid to appear - BUT the selections to disappear.

A bit a choice between plague and cholera....

Is there any smart way of keeping the datagrid intact? Submitting saves the selections in a Session - and then opens a detailed report with the selected items from the session. So I basically was thinking of a way of doing postback - but without really doing it.

thomzon
09-12-2005, 04:00 AM
Any suggestions would be appreciated.
I am stuck here.

thomzon
09-13-2005, 10:09 AM
I did a post on the asp.net forum and got a great answer that solved the problem.

http://forums.asp.net/1049173/ShowPost.aspx