Asp.net + Hiding Tree View nodes ?
-
Hello Friend, I am using a treeview and populating it from web.sitemap. On the basis of text vlaue I want to hide some nodes for the users. I am not finding how to hide the nodes. can any one help me please. thanks
Naveed Kamboh
-
Hello Friend, I am using a treeview and populating it from web.sitemap. On the basis of text vlaue I want to hide some nodes for the users. I am not finding how to hide the nodes. can any one help me please. thanks
Naveed Kamboh
Hi, I'm not sure if this is what you are looking for but here goes. Tree Looks like this Tree Node 1 Tree Node 1 a Tree Node 1 b Tree Node 1b i Tree Node 1b ii Tree Node 1 c Lets say you want to hide Tree Node 1b ii TreeView.DataSource = SiteMapDataSource1; TreeView.DataBind(); TreeView.Nodes[0].ChildNodes[1].ChildNodes.RemoveAt(1); //This hides tree node 1b ii Hope this helps. Remember in order to do this you have to programatically bind the TreeView. Note remove the DataSourceID from the IDE first. Good luck
Cheers Disgyza Programmer Analyst
-
Hi, I'm not sure if this is what you are looking for but here goes. Tree Looks like this Tree Node 1 Tree Node 1 a Tree Node 1 b Tree Node 1b i Tree Node 1b ii Tree Node 1 c Lets say you want to hide Tree Node 1b ii TreeView.DataSource = SiteMapDataSource1; TreeView.DataBind(); TreeView.Nodes[0].ChildNodes[1].ChildNodes.RemoveAt(1); //This hides tree node 1b ii Hope this helps. Remember in order to do this you have to programatically bind the TreeView. Note remove the DataSourceID from the IDE first. Good luck
Cheers Disgyza Programmer Analyst
thank you very much dear, it worked. I am happy.
Naveed Kamboh