We are looking at upgrading to an UltraWebTree but am having some issues.The way we used to do it was load the data by levels using the OnDemandLoad event that fires when a node is expanded.
This event is no longer available and the closest thing I found OnNodePopulate doesn't get called as the code now only loads the top level assets without there expand icon.
The DataSource uses an an asset_id and an asset_id_parent to define the hierarchy where the root node has a null parent. All the samples I have found on your sire use multiple data to at most 2 levels whereas this is multi-level. The data can get quite big so loading it all at once isn't feasible.
Can you provide some sample code that does what UltraWebTree used to do
Thanks
Hi AtomicSpoon,
Thank you for posting in the community.
As far as I can understand you need to implement manual load on demand given that only the root level is loaded on the initial page load. This can be achieved by initially setting the IsEmptyParent property of the roow nodes to true (at the NodeBound stage) and afterwards, handling the NodePopulate event as needed. A sample illustrating such a scenario may be found at:
http://samples.infragistics.com/aspnet/Samples/WebDataTree/Performance/ManualLoadOnDemand/Default.aspx?cn=data-tree&sid=c257cd9c-1c5a-4159-aa51-ff8ea8386395
Below is the relevant code for configuring a node as an empty parent:
void WebDataTreeSample_NodeBound(object sender, DataTreeNodeEventArgs e) { //You would have business logic that determines if IsEmptyParent should be set or not. For this sample we are just turning it on. e.Node.IsEmptyParent = true; }
Please let me know if this helps.
Please feel free to contact me if you have any questions regarding this scenario.
Hi Petar,
May I know the command on how to check in WebDataTree if any of the node is selected/click? I need to enable a search button once any node (initially the Root node) is clicked.
Appreciate the help. Thanks!
Hi cdptlc,
Please refer to the following thread regarding this matter:
http://forums.infragistics.com/forums/t/66711.aspx
Sorry for not getting back to you ealier but other things came out.
You are right. node.ShowExpand =true; just needed to be replaced by node.IsEmptyParent =true;
i.e.
// Does node have children?
if (row["CHILDREN_EXIST_FLAG"].ToString().ToUpper() == "Y")
{ node.ShowExpand =true;
}