LoadOnDemand more node levels

5 replies. Last post: August 3, 2014 10:57 PM by Hans Kristian
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hi,

I have WebTreeView with LoadOnDemand enabled. Is it posibble to load several nodes from server on node expand (not on same level)? In codebehind something like this

protected void WebTreeView1_InitializeChildNodes(object sender, ISNet.WebUI.WebTreeView.WebTreeViewNodeEventArgs e)
    {
        WebTreeViewNode node1 = new WebTreeViewNode("level 1");
        WebTreeViewNode node2 = new WebTreeViewNode("level 2");

        node1.Nodes.Add(node2);
        e.Node.Nodes.Add(node1);
    }

This load only node1.

In our application we have button, which expand tree to show certain nodes (by type). Nodes can be on any level. We use classic ASP TreeView where this is no problem - loadondemand, but on server i can prepare nodes and it worked.

With WebTreeView i must use "workaround" - on server (button click event) prepare all nodes and their path, save this for javascript and when page loads expand first node. Then WebTreeView have clientside event OnNodeExpand where i take next path to expand, find the node a and call Expand() on it. And so on, until all nodes are expanded. But it can take a long time, because its client - server comnunication for every node. Basicaly emulate user clicking.

Is this the only way to achive this? 

All times are GMT -5. The time now is 6:47 AM.
Previous Next