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:
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
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; } }
What kind of load-on-demand setting are you using?
If you're using ManualSmartCallbacks, then this would be expected. During the AJAX callbacks where the DemandLoad event is raised, only the data path of the node is passed from the client to the server (as e.DataPath), and other values will be null. This isn't always obvious when you're adding nodes to the second level of the tree, because the first level can be populated during the callback in some circumstances; second and later levels won't be pouplated.
You should put enough information in the DataPath so that you know exactly where in your hierarchy the node belongs.