日期:2014-05-17 浏览次数:20824 次
ID ParentID Level
1 0 0
2 0 1
3 0 1
4 0 2
5 0 3
6 0 3
7 0 1
8 0 0
9 0 1
10 0 2
11 0 2
12 0 0
0级 1级 2级 3级
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
ID ParentID Level
1 0 0
2 1 1
3 1 1
4 3 2
5 4 3
6 4 3
7 1 1
8 0 0
9 8 1
10 9 2
11 9 2
12 0 0
private void Button_Click_1(object sender, RoutedEventArgs e)
{
//原始示例数据。
List<Data> data = new List<Data>();
data.Add(new Data { ID = 1, ParentID = 0, Level = 0, });
data.Add(new Data { ID = 2, ParentID = 0, Level = 1, });
data.Add(new Data { ID = 3, ParentID = 0, Level =&nb