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

TreeViewAdv

How do you get the parent of TreeViewItemAdv or how do you get the path of a TreeViewItemAdv.

I need to be able to programmtically expand the path of a node and bring the child node into view. How can I do that?

1 Reply

PK Prathap K.N Syncfusion Team March 9, 2010 04:38 AM UTC

Hello Archer Tech team,

Thanks for using Syncfusion products.

We can get the parent of the TreeViewItemAdv, Please find the below code snippet.

ItemsControl parent = TreeViewItemObj.ParentItemsControl;

TreeViewItemAdv tviSel = TreeViewObj.ItemContainerGenerator.ContainerFromItem (TreeViewObj.SelectedItem) as TreeViewItemAdv;

Also we can programmatically expand the path of a node and bring its child into view from the below code snippet,

TreeViewItemObj.IsExpanded = true;
TreeViewObj.BringIntoView(TreeViewItemObj);

Hope these code snippets will provide you a solution. Please let us know for any further clarifications.

Regards,
Prathap

Loader.
Live Chat Icon For mobile
Up arrow icon