I need to traslate the code behind used with ultrawebtree, and now I'm porting the code to WebDataTree.
I don't know How to translate some code, can't find or I'm, not sur eabou the equivalent:
aNode.FirstNode
and
UltraWebTree1.SelectedNode = aNode;
qDMQ_ID_DOMANDA_QUESTIONARIO = Convert.ToInt32(UltraWebTree1.SelectedNode.DataKey.ToString());
Also this :
(int)UltraWebTree1.Nodes[i].Nodes[b].DataKey;
Sonething link this:
dk = Convert.ToInt32(UltraWebTree1.Nodes[0].FirstNode.DataKey);
UltraWebTree1.SelectedNode = UltraWebTree1.Nodes[0].FirstNode;
Hello Giuseppe,
Thank you for using our community.
Here are some guidelines that should help you with the migration:
If you want to reach the first child node of the first root node use the following code:
WebDataTree1.Nodes[0].Nodes[0]
Where WebDataTree1 is the ID of the WebDataTree. From here you can get the Key property as in your code snippet.
WebDataTree1.Nodes[0].Nodes[0].Key
If you want to mark a particular node as selected use the relevant property.
WebDataTree1.Nodes[0].Nodes[0].Selected = true;
If you want to mark all children nodes of a particular node as selected, just loop through them:
for (int i = 0; i < WebDataTree1.Nodes[0].Nodes.Count; i++)
{
WebDataTree1.Nodes[0].Nodes[i].Selected = true;
}
As WebDataTree is quite different from UltraWebTree I highly recommend you to go through the online documentation and read more about the control and it’s options. What is more you can find some online samples that can help you better understand the control. Here are some useful resources:
http://www.infragistics.com/samples/aspnet/data-tree/loading-nodes
http://help.infragistics.com/Doc/ASPNET/Current/CLR4.0?page=Web_WebDataTree.html
http://help.infragistics.com/Doc/ASPNET/Current/CLR4.0?page=Infragistics.Web.UI.NavigationControls.DataTreeNode_members.html
There are many topics in our forum relevant to your case so you can relate to them:
http://www.infragistics.com/community/forums/t/91567.aspx
http://www.infragistics.com/community/forums/t/77028.aspx