Viewstate question

A

Anonymous

Hello,

I am adding a new column to my datagrid in the init of
my webform. The new column is created in my extended web
control which is derived from the datagrid. The
usercontrol contains a nested datagrid. Now the problem is
that the viewstate of this control is not maintained.
Where I am supposed to add this column? Can anybody help
me please?

Thanks
 
B

Brock Allen

If you're dynamically adding controls then you need to recreate those controls
in Page_Init or override CreateChildControls so that the postback has a chance
to map the posted data onto these dynamically created controls. If you wait
until Page_Load then it's too late.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Viewstate 4
ViewState 0
DataGrid BoundColumns and ViewState - A Question 1
Question about my projects 3
Viewstate general question 0
SortExression is not updated 0
ViewState 0
viewState & datagrid 1

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top