Suppose I have a table in DB like:
Tab(id, parentid);
by EF, I can get the data collection as a tree like 开发者_开发问答IQueryable by wcf service. say the data like id parentid
1, nul
2, 1
3, 1
4, 2
5, 2
6, 4
7, 4
8, 4
9, 1
Then I want to bind this data to a treeview, how to implement it?
This data will be ItemsSource for you TreeView control. This article answers for you - How to Display Hierarchical data
精彩评论