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

How to access child TreeViewItemAdv from a TreeViewItemAdv

I'm trying to create a selection tree. Whenever a button in a parent node is clicked, the children nodes should all be selected.
My problem is i can't find the containers of the children nodes (TreeViewItemAdv collection) from a parent TreeViewItemAdv

I can manually get a container by calling
ParentNode.ItemContainerGenerator.GetContainerFromItem(childData)

But there's another problem, if the ParentNode is collapsed, the child containers haven't been instantiated. Setting ParentNode.IsExpanded = true does not synchronously generate the item containers as I expected.

How do I solve this problem?
Thank you

1 Reply

PP Prabhu P Syncfusion Team September 15, 2009 02:56 PM UTC

Hi Jackdoh,

Thank you for your interest in Syncfusion products.

We have a method named as AddNodeToSelectedItems() for selecting one or more nodes from the Treeview children collection. We have created a simple sample with all your requirement. Please find the sample from the link given below.

http://files.syncfusion.com/support/Tools.WPF/7.3.0.20/F89977/main.htm

Hope this sample will meet requirement. Please let us know if you have any other further queries.

Thanks,
Prabu

Loader.
Live Chat Icon For mobile
Up arrow icon