If the treeview is built from a data source, you can use the TreeNodeDataBound event to acheive this. But its not as simple as doing
e.node.visible because as I said, visible is not a property
Even treeviewControl.Nodes.Remove(e.node) will not work if you are trying to remove a node that is a leaf node (node that does not have children).
So to remove a node, just try this code
e.Node.Parent.ChildNodes.Remove(e.Node);
No comments:
Post a Comment