-
- MattNiznak
- Posts: 8
- Joined:
Walking a TreeView
Is it possible to get the root node of the TreeView, iterate over it's children, find their parents, children, and get values related to their elements?
The problem that I'm trying to solve is that I have an external tree data structure that I'd like the treeview to mirror, as well as be able to make changes and push any changes in that relationship back to the original tree data structure.
The problem that I'm trying to solve is that I have an external tree data structure that I'd like the treeview to mirror, as well as be able to make changes and push any changes in that relationship back to the original tree data structure.
-
-
sfernandez
Site Admin
- Posts: 3364
- Joined:
Re: Walking a TreeView
There are some useful function in the VisualTreeHelper class to navigate visual tree. Analog to that there is a LogicalTreeHelper to navigate the logical tree.
You can also use ItemsControl.ItemsControlFromItemContainer() to find parent ItemsControl for TreeViewItems. With this function you can reach the top TreeView from any TreeViewItem.
Please let me know if that helps.
You can also use ItemsControl.ItemsControlFromItemContainer() to find parent ItemsControl for TreeViewItems. With this function you can reach the top TreeView from any TreeViewItem.
Please let me know if that helps.
Who is online
Users browsing this forum: Bing [Bot] and 8 guests