Hello
I want to bind list to TreeView. But it should work like that:
I work with entity framework. In easiest case I have 2 tables with 2 associations.
Customer
Product
Customer is connected with itself
Customer.CustomerID - Customer.ParentID
and
Product.CustomerID - Customer.CustomerID
Right now I want to populate TreeView and achieve something like this:
Customer1
SubCustomer1
Product1
Product2
Product3
Customer2
Product4
Customer3
SubCustomer2
Product5
SubCustomer3
SubCustomer4
Product6
Product7
Product8
I want to see only Name properties and somehow detect which one is clicked.
Customer Table has 3 navigation properties
Products
CustomerChildren
CustomerParent
Product table has 3 navigation properties but I don't want to use it in TreeView.
In runtime I want to click on some Product, detect that Product is selected (stop if customer is selected) and then make some database modification according to other controls.
Can someone help?