Last post Dec 11, 2006 02:26 PM by Russ Helfand
Dec 11, 2006 10:30 AM|mjphillips|LINK
I see from the samples (PopulateOnDemandTreeView.aspx) that I need to wire up a click handler for the OnAdaptedSelectedNodeChanged event.
However, I'm adding my control to the Form programatically in the code behind, and I see no AdaptedSelectedNodeChanged delegate (whereas I do see them for the 'classic' events such as OnSelectedNodeChanged).
How do I wire up a click handler for the AdaptedSelectedNodeChanged event in code?
"css friendly adapter"
treeview programmatically populate OnAdaptedSelectedNodeChanged OnSelectedNodeChanged
CSS Control Adapters
Dec 11, 2006 02:26 PM|Russ Helfand|LINK
Interesting scenario, Matt. You are quite correct when you say that AdaptedSelectedNodeChanged is not treated like a normal event (i.e., has no event delegate, etc.). The adapter uses a somewhat tricky approach. Because it can't simply add events to any
control willy-nilly, it effectively adds new events (like Adapted* events) by using simple attributes (formally they are known as expando attriutes). So, to programmatically add the handling of OnAdaptedSelectedNodeChanged you should use something like this:
This is the programmatic equivalent of putting the OnAdaptedSelectedNodeChanged expando attribute onto the <asp:TreeView> tag (if you were using markup).