Click here to Skip to main content
15,922,007 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating an application for chatting in WPF(C#.net).
I have created a class User with following attributes:
1.Company_name
2.Branch
3.Designation
4.User_name
I am getting the list of objects of class user.
I want to display the users in treeview as:

Company name1
-Branch1
-:Designation1
-User name1
-User name2
-Branch2
-:Designation1
-User name3
-:Designation2
-User name4

when user list is refreshed, the tree structure will reloaded.
I want to create this tree structure considering users with same parent.
I am getting the user list at run time when a new user logs in.
How to create such tree?
I want to know, how to create such treeview using ViewModel and display it in WPF window??
Posted
Updated 23-Sep-11 23:49pm
v6
Comments
BillWoodruff 23-Sep-11 8:54am    
I think you are not using 'multiple types of objects' here, but simply multiple Nodes in a TreeView with varying text displayed in the Nodes.

You might want to edit the title of your question.

1 solution

Start with Josh Smith's article here on CP: Simplifying the WPF TreeView by Using the ViewModel Pattern[^]
 
Share this answer
 
Comments
Abhinav S 24-Sep-11 5:21am    
Good link.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900