标签:nbsp tno roo pre 结构 code tree 内容 each
1.表结构内容
2.代码
public void InitData() { using (var db = new HJSDR_BJXH_20170303_TESTEntities()) { pyFiles = new PyFiles(); TreeNode rootNode = null; TreeNode typeNode = null; foreach (var item in db.ED_KPI_INFO) { if (!tv_singal.Nodes.ContainsKey(item.SD_CODE)) { rootNode = new TreeNode(item.SD_CODE); rootNode.Name = item.SD_CODE; tv_singal.Nodes.Add(rootNode); } if (!rootNode.Nodes.ContainsKey(item.KPI_TYPE_CODE)) { typeNode = new TreeNode(item.KPI_TYPE_CODE); typeNode.Name = item.KPI_TYPE_CODE; rootNode.Nodes.Add(typeNode); } if (typeNode != null) { typeNode.Nodes.Add(item.KPI_NAME,item.KPI_NAME); } } }
3.效果
标签:nbsp tno roo pre 结构 code tree 内容 each
原文地址:http://www.cnblogs.com/wuhailong/p/7001263.html