We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to make a treeNodeAdv visible FALSE

Thread ID:





76371 Sep 4,2008 06:17 AM UTC Nov 13,2008 10:59 AM UTC WinForms 3
Tags: Tools
Asked On September 4, 2008 06:17 AM UTC

Hi SyncFusion Team
I need to hide a node of treeviewAdv but cannot find something appropriate to hide a single node of tree something like TreeNodeAdv.Visible= FALSE or so.

Can you please help me in this regard.


Hemaladha K [Syncfusion]
Replied On September 8, 2008 09:47 AM UTC

Hi Maverick,

Thank you for your interest in Syncfusion Products.

TreeNodeAdv isn't a control so it doesn't have a Visible property. It's just a data structure for telling the tree what to render, so the absence of the TreeNodeAdv in the TreeViewAdv's Node's collection will prevent it from displaying. The IsVisible() property returns true when the parent node is expanded, otherwise is returns false. There is no property to hide or display a node.

Please let me know if any concern.


Administrator [Syncfusion]
Replied On November 11, 2008 07:28 AM UTC

since TreeNodeAdv is not a control, there is no way to hide this tree node?

I have a tree like this:

what I want to do is to hide tree node 2 in some cases or to hide tree node 3 in some cases or to show all tree nodes in other cases, how can I do this?

the only tree is to rebuild the whole tree in every condition?

I think if there is a way to hide tree node, we can filter tree nodes which we don't want to see, so we only need construct the whole tree only once.

Fathima Shalini P [Syncfusion]
Replied On November 13, 2008 10:59 AM UTC


Thank you for your update.

Since TreeNodeAdv doesnot have any built in method or property to hide or show TreeNodeAdv, please find the below workaround that hides and shows the TreeNodeAdv by changing its Height and Text property:

private void button1_Click(object sender, EventArgs e)
for (int i = 0; i < this.treeViewAdv1.Nodes.Count; i++)
if (i % 2 == 0)
this.treeViewAdv1.Nodes[i].HelpText = this.treeViewAdv1.Nodes[i].Text;
this.treeViewAdv1.Nodes[i].Text = "";
this.treeViewAdv1.Nodes[i].Height = 0;
private void button2_Click(object sender, EventArgs e)
for (int i = 0; i < this.treeViewAdv1.Nodes.Count; i++)
if (this.treeViewAdv1.Nodes[i].Height == 0)
this.treeViewAdv1.Nodes[i].Text = this.treeViewAdv1.Nodes[i].HelpText;
this.treeViewAdv1.Nodes[i].Height = 16;

Please refer to the below sample that illustrates this:


Please let me know if any concerns.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon