ViewState for Inner Class

J

Jinsong Liu

I am creating a web custom control by extending the existing DataGrid
control. lets call it MyDataGrid here. I instantiated another class
which is also drived from the DataGrid control in the MyDataGrid. the
ViewState of the inner class get lose between page reload. is there
anyway that I can maintain the viewstate of my inner class?

thanks

Jinsong
 
T

Teemu Keiski

Hi,

you need to put the child control properly to parent control's Controls
collection so that it is capable to keep its ViewState along with the page
lifecycle. Is this a problem with your current control?

Another way I could think of is that you override state management methods
of parent MyDataGrid and in those you call the equivalent methods of the
child control (inner class) so that MyDataGrid handles it for the inner
grid.
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top