I have using WebTree with Manual LoadOnDemand feature. I am facing an issue on click on child nodes being added in DemandLoad event. TreeView is getting refreshed and restoring the original state (not maintaing the current state). Even the NodeClicked event is not getting triggered for these nodes.
I am not sure what am i missing.
Thanks a lot Vince.
I have followed the implementation suggested in the knowledge base article. It's working as expected now.
I see you're using Manual Smart Callbacks for your load-on-demand type, not Manual. That's likely the difference.
You need to store some information in each node's DataPath property, so that you can uniquely identify the node during each callback. This is because the parent node's DataPath is all the information you get upon subsequent callbacks to the DemandLoad event. The following article from our online Knowledge Base has more information:PRB: State of new nodes is lost when using ManualSmartCallbacks for WebTree
Thanks a lot Vince for your response.
I am not clearing existing nodes. Initially on load, i am displaying two levels in the treeview. I am adding child-nodes in DemandLoad method for requesting node. Everything is fine on selecting 1st level nodes,. But 2nd level (which was added in DemandLoad) selection, causes the treeview refresh and again only two levels are being displayed as was on load.
This is how i'hv defined my datagrid control. ...
<ignav:ultrawebtree runat="server" ID="TreeView1" FullNodeSelect="True" Indentation="10" InitialExpandDepth="3" ExpandOnClick="True" Width="100%" LoadOnDemand="ManualSmartCallbacks" SingleBranchExpand="true" ondemandload="TreeView1_DemandLoad" EnableViewState="true" onnodeselectionchanged="TreeView1_NodeSelectionChanged" > ...
protected void TreeView1_DemandLoad(object sender, Infragistics.WebUI.UltraWebNavigator.WebTreeNodeEventArgs e)
{ // Adding nodes in e.Node using result of Database call..
e.Node.Nodes.Add("ChildNode"); }
I suspect you're doing something to clear the existing nodes of the tree and recreate them. Ensure that your tree's EnableViewState property is set to true, and that you're not databinding it on postbacks (such as in the Page_Load event handler).