开发者

How to bind data from DB to a treeview in silverlight?

开发者 https://www.devze.com 2023-01-26 02:23 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消