Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
WebTree Check All Child Nodes With Demand Load
posted

We have a web tree and want to give the user the ability to check the parent node and have it automatically check the child nodes.  The only problem is that we are using demand load.  We can get around most issues except for the following scenario:

  1. Create a tree that has a parent, children, and grandchildren and uses demand loading and has checkboxes next to each node
  2. Expand the parent by clicking the plus sign
  3. Check the box next to the parent

We have JavaScript like in the example given at http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=4941.  The only thing we added was "if (bCheck && !childNodes[n].getExpanded()) { childNodes[n].setExpanded(true); }".  This way we will expand the children to expose the grandchildren (since they are only loaded on demand).  On the server side DemandLoad event we check if the node is checked and if so, raise the OnDemandLoad(NEWLY_ADDED_NODE) method off the web tree so we load all the child nodes down the chain.  The problem is that when we are in the DemandLoad server-side event, it doesn't recognize that the node has been checked.

Any help would be greatly appreciated.  Thanks

Parents
No Data
Reply
  • 163
    posted

     Good day!

     We have the similar problem with the DemanLoad:

    We want generate multilevel tree with the DemandLoad. We are normally load first and second level, but weird - when we try to load third level, in e.Node.Parent we have "null" and Text is also "null". What could this be?

     Thank you!

    Source:

       protected void Page_Load(object sender, EventArgs e)
            {
                UltraWebTree1.Nodes.Add("Test").ShowExpand = true;
                UltraWebTree1.Nodes.Add("One").ShowExpand = true;
            }

            protected void UltraWebTree1_DemandLoad(object sender, Infragistics.WebUI.UltraWebNavigator.WebTreeNodeEventArgs e)
            {
                if(e.Node.Text == "Test")
                {
                    e.Node.Nodes.Add("Test").ShowExpand = true;
                    e.Node.Expanded = true;
                }
                if(e.Node.Text == "One")
                {
                    e.Node.Nodes.Add("One").ShowExpand = true;
                    e.Node.Expanded = true;
                }
            }

Children