Hi,
I am upgrading from UltraWebTree to WebDataTree.
In UltraWebTree, has Find method to find node with specific Tag as shown below
Node
parentNode = treeMap.Find(menuItem.ParentId);
Where menuItem.ParentID is set as Tag property of the Node.
as shown:
Node newNode = new Node();
newNode.Text = menuItem.MenuText;
newNode.Tag = menuItem.MenuId;
But in WedDataTree, I am not able to see Find method so I was using FindNodeByValue. But this method returns only root level node collection. I am binding tree with an object in code behind. I am able to populate root node but not able to add child node at specific location. Please let me know what is replacement of Find method in WebDataTree.
Please help its very urgent
Amar
I did try as stated above. Working as expected
Thanks
Hello Amarjeet,
Please feel free to contact me if you need any further assistance with this matter.
Thank you for posting in our community.
What I can suggest for replacing the Find method form UltraWebTree is using FindNodeByKey. For example :
this.WebDataTree1.Nodes.FindNodeByKey("ParentNode1");
Please note that FindNodeByKey will only return the node on the specific collection on which you called the method.
In order to find a specific node based on its key in the complete list of nodes in the tree you can use AllNodes property which will return an array list with all nodes in the tree in depth-first order. You can loop in that collection and check the related Key of each code. For example:
ArrayList nodesList = WebDataTree1.AllNodes; for(int i=0; i<nodesList.Count; i++) { if (((Infragistics.Web.UI.NavigationControls.NavItem)(nodesList[i])).Key == "ChildNode1.2") { //your code here } }
ArrayList nodesList = WebDataTree1.AllNodes;
for(int i=0; i<nodesList.Count; i++)
{
if (((Infragistics.Web.UI.NavigationControls.NavItem)(nodesList[i])).Key == "ChildNode1.2")
//your code here
}
I hope you find this information helpful.
Please let me know if you need any further assistance with this matter.