Quantcast
Channel: VBForums - WPF, WCF, WF
Viewing all articles
Browse latest Browse all 256

How to find parent of selected item in TreeView?

$
0
0
Okay, using Windows 7 with VS2012 and .NET 4.5 in a WPF application, I have a multi-level treeview that looks like this:

Name:  TreeView.jpg
Views: 116
Size:  7.4 KB

The TreeView is bound to an observable collection of the codes. What I want SHOULD be simple, but it's not turning out to be so. Let's assume that the user clicks on the "6010F-8P" item... how can I find the parent item ("6015F-00")? The data can be up to four levels deep, and I need to be able to backtrack up the entire chain to find not only the root item, but also each parent along the way.

I have searched and searched, but can't find any way to do this. Is there any way for the TreeView control to do find the parent item of a selected item?

Thanks in advance...
Attached Images
 

Viewing all articles
Browse latest Browse all 256

Trending Articles