//方法待改造和迁移 public void CategoryTreeTable(IList <Category> result, int parentId, int depth) { var list = CategoryList.FindAll(p => p.ParentId == parentId); foreach (var item in list) { var parentDsc = "treegrid-" + item.ID; item.DepthDescription = depth == 0 ? parentDsc : parentDsc + " treegrid-parent-" + item.ParentId; result.Add(item); CategoryTreeTable(result, item.ID, item.Depth); } }