How to get the header of the parent node of a selected TreeViewItem?

Posted by Dabblernl on Stack Overflow See other posts from Stack Overflow or by Dabblernl
Published on 2010-04-04T19:51:57Z Indexed on 2010/04/05 10:23 UTC
Read the original article Hit count: 287

Filed under:
|
|
|

I have this TreeView:

Main Node Header="Main"
   Sub Node Header="Sub1"
      Final Node Header="Item1"
      Final Node Header="Item2"
   Sub Node Header="Sub 2"
      Final Node Header="Item1"
      Final Node Header="Item2"

I have two textboxes that are bound to this TreeView. One has its Text property bound to the TreeView's SelectedItem property and works OK.

The other TextBox I want to bind to the Header text of the Sub Node directly above the selected Item.

How do I reference it?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about wpf