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. Image for the cookie policy date
close icon

get nodes that have subitems on Treeviewadv

hi...

i have some problem on treeview
i have 2 columns
subitems filled random, i want to get each node that has subitem, and hide nodes that hasnt subitem

is it possibel for me?


1 Reply

FS Fathima Shalini P Syncfusion Team May 8, 2008 08:25 AM UTC

Hi Sherly,

Thank you for your interest in Syncfusion Products.

I have created a simple sample according to the scenario that you have mentioned. The sample contains MultiColumnTreeview control that has 2 columns. I have added subitems at runtime to the alternate nodes and showed only the nodes that has subitem. Please find the following code snippet that hides the nodes that has no sub item:


for (int j = 0; j < this.multiColumnTreeView1.Nodes.Count;j++ )
{
if (this.multiColumnTreeView1.Nodes[j].SubItems.Count ==1)
{
this.multiColumnTreeView1.Nodes[j].Visible = false;
}
}


Please find the sample in the following link:

http://websamples.syncfusion.com/samples/Tools.Windows/F73371/main.htm

Please let me know if any concerns.

Regards,
Fathima



Loader.
Live Chat Icon For mobile
Up arrow icon