I'm playing with Linq-SQL and would like to display my data in a TreeView on a form. I'm also using .net 3.5, if that matters.
Now, my question - is there a better way to populate this treeview? The way I'm doing it now is like this (psuedo):
for each order
{
OrderNode = new TreeViewNode
for each product in order
{
ProductNode = new TreeViewNode
OrderNode.Add(ProductNode)
}
OrdersTreeView.Add(OrderNode)
}
Thanks in advance!