Home All Groups Group Topic Archive Search About
Author
3 Mar 2005 4:46 PM
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

Author
18 Mar 2005 1:09 PM
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.

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> 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
>