Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Tree Help

Status
Not open for further replies.

sayan

ISP
Feb 13, 2002
11
0
0
TH
I've created a datatree and now based on some fields of my form I need to hide some nodes of it. I thought the way to make a node invisible was to set it's visible property to FALSE. Something like this:

tvwDBsel.Nodes(x).Visible = False

The problem is that when I try this an error occurrs saying that this problem is read-only. Anyone has any idea on how to overcome this or there is no possibility of changing the visible property of a node?
Thanks in advance
 
The Visible property of the Treeview control's Node object is read-only at run time. You can set the Expanded property of the parent of the node you want to hide to false which simply collapses the branch. Or, if the load process is quick enough, clear the tree and reload without the node.

Mark
 
Thanks Mark. I did thought on the idea of building the data tree again, but I thought there would be a less resource consuming away. The idea to don't allow the nodes to expand wouldn't work for this case, so I guess I'll really need to build the datatree again each time I need to hide some node.
 
Well, actually I found that I don't need to rebuild the data tree...
I can use the function remove(Node_Index) to remove just the nodes I want from the tree view. Of course that if I need this nodes back on the data tree I'll have to rebuild it again, but this way is much less resource consuming.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top