I'm using Microsoft.Web.UI.WebControls.TreeView in my existing project, which is not working in all browsers(IE10). After searching in Bing/Google I came to know that this treeview is no more in use, and has been replaced by System.Web.UI.WebControls.TreeView. So I'm trying to replace the new treeview. Here I'm facing some issues with some properties. Can anyone tell me the equivalent properties for the new System.Web.UI.WebControls.TreeView?
Microsoft.Web.UI.WebControls.TreeView TV1;
TV1.TreeNodeSrc = xml.OuterXml;
string index = TV1.SelectedNodeIndex;
txtObject.Text = TV1.GetNodeFromIndex(nodeIndex).Text;
tnDDAO = ((MSWebControls.TreeNode)TV1.GetNodeFromIndex(nodeIndex).Parent);
Try this
See this example in MSDN
To get the index of the selected node use
TreeView TV1 = new TreeView(); TV1.Nodes.IndexOf(TV1.SelectedNode).ToString();
To get the Text of the selected node use
TreeView TV1 = new TreeView(); txtObject.Text = TV1.SelectedNode.Text;
To find a node use FindNode method
TV1.FindNode
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.