Hey guys, I have a WPF TreeView that has three nodes, I would like the last child (the third node) to contain a ListView populated with my bound data. The issue that I'm running into is that if I put a ListView in the ItemTemplate of my HierarchicalDataTemplate I get a ListView for each child rather than a single ListView with content. This is expected behavior per the documentation, but I'm looking for a work around (possibly modify the ItemContainerStyle), unfortunately I have virtually no experience with the TreeViewItem's control template, or for that matter much experience with TreeViews in general.
I've looked at the posibility of using a TreeListView but it doesn't fit my use case, nor does binding a separate control and displaying data that way.
Has anyone either already gone through the headache of sandwiching a ListView into a TreeViewItem, or can someone suggest how to modify the ControlTemplate to accomplish this?
Thank you, Aj
Turns out the easiest way to deal with the situation is to replace the HierarchicalDataTemplate on the second node with an Expander, set the ItemsSource on the ListView rather than the HierarchicalDataTemplate, and restyle the button on the Expander to look like the one from a TreeViewItem....sorta a hack but it works :)
Thanks for all the help,
Aj