I have several RadTreeViews, some whose nodes are static and some whose nodes use TreeNodeExpandNode.WebService to load the nodes on demand. The number of TreeViews is dynamic, and thus I need to build them from scratch in codebehind (RadTreeview tree1 = new RadTreeview()).
My page has a Submit button which causes a postback. Since my trees are dynamic, I am forced to rebuild them for each postback.
The problem is with the node state. On the first postback and subsequent tree rebuilds, the tree is displayed as the user left it (expanded nodes, checked nodes, and all). But if the user submits again, causing a second postback, the tree is collapsed and, if the nodes selected are from a subnode of one using the web service, those checked are not remembered.
Is there something I can do to (a) prevent the trees from collapsing and (b) rememeber all nodes that were checked prior to the postback, no matter how many subsequent postbacks occur?