I have a list of TransactionTypes
and I want each of these to be added as Nodes
/ TreeViewItems
on a TreeView, under another TreeViewItem
called 'Audit'
.
Is there a way to convert each individual item in the list into a new TreeViewItem
in a TreeView? And if so, how can it be done most efficiently?
Thanks.
EDIT:
We are using a WPF application and therefore can't use .Nodes / TreeNodes.
This should work
This is asumming that your
TreeViewItem
has aheader
property and is declared similar to thisThere is probably a more compact way using LINQ but internally is still a loop
Here is a great example of using TreeView in WPF