The company has the traditional complex organizational structure, defining the amount of levels using the letter 'n' rather than an actual number. I will try and express the structure I'm trying to achieve in mono-spaced font:
Alice
,--------|-------,------,------,
Bob Fred Jack Kim Lucy
| |
Charlie Greg
Darren Henry
Eric
As you can see it's not symmetrical, as Jack, Kim and Lucy report to Alice but have no reports of their own.
Using a TreeView
with an ItemsPanel
containing a StackPanel
and Orientation="Horizontal"
is easy enough, but this can result in a very large TreeView
once some people have 20 others reporting to them! You can also use Triggers
to peek into whether a TreeViewItem
has children with Property="TreeViewItem.HasItems"
, but this is not in the same context as the before-mentioned ItemsPanel
. Eg: I can tell that Fred has reports, but not whether they have reports of their own.
So, can you conditionally format TreeViewItems
to be Vertical if they have no children of their own?