all groups > asp.net building controls > june 2004 >
You're in the

asp.net building controls

group:

ViewState for Inner Class


ViewState for Inner Class Jinsong Liu
6/30/2004 11:36:09 PM
asp.net building controls: 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

Re: ViewState for Inner Class Teemu Keiski
7/1/2004 6:11:35 PM
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.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke



[quoted text, click to view]

AddThis Social Bookmark Button