I need to get the TreeViewItem control that hosts the object referenced by a TreeView control's SelectedItem property. I'm currently having to work my way down the tree (as I have a reference to each parent object), node by node, and calling ItemContainerGenerator.ContainerFromItem method on each TreeViewItem node. It's unfortunate that the ItemContainerGenerator.ContainerFromItem method only searches for object in it's Items collection or I could call this method on the root node and get the TreeViewItem control that way.
Is there a better way of doing this Any help or suggestions would be appreciated. Thanks.
Kevin

TreeViewItem Container from TreeView SelectedItem Property
Oscar Marin
BTJ
I use quite the same approach in TreeViewEx.
Have a look at http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1147108&SiteID=1.
Lawrence Parker