K
Keith Patrick
I'm trying to do the old "dynamically create controls via LoadControl don't
fire events" thing, but whereas normally, I could put some code in the
viewstate handlers to put the controls back into the control hierarchy
during initialization, the problem in my case is that my base control is a
TreeView, and a TreeView cannot have controls in its Controls collection
(each node contains a usercontrol). Because of that, while I can create the
controls during LoadViewState just fine, I have no place to put the controls
(such as the Controls collection of a parent) that would result in the
events getting wired in. I'm not aware of a way to manually add the event
handlers (i.e. what does OnInit call that wires in the events), so where
could I store the usercontrols to allow them to get initialized with rest of
the control and thus connected to its event handlers?
fire events" thing, but whereas normally, I could put some code in the
viewstate handlers to put the controls back into the control hierarchy
during initialization, the problem in my case is that my base control is a
TreeView, and a TreeView cannot have controls in its Controls collection
(each node contains a usercontrol). Because of that, while I can create the
controls during LoadViewState just fine, I have no place to put the controls
(such as the Controls collection of a parent) that would result in the
events getting wired in. I'm not aware of a way to manually add the event
handlers (i.e. what does OnInit call that wires in the events), so where
could I store the usercontrols to allow them to get initialized with rest of
the control and thus connected to its event handlers?