标签:des style blog color 数据 for ar div
private void TreeListBind(DataTable dt, int p) { treeList1.Nodes.Clear(); if (dt.Rows.Count < 1) return; DataView dv = new DataView(dt); dv.RowFilter = "ParentFieldName=" + p; if (dv.Count < 1) return; TreeListNode Node = treeList1.AppendNode("id", null); Node.SetValue(treeListColumn1,"第一个节点名"); foreach (DataRowView dv1 in dv) { TreeListNode tn = treeList1.AppendNode(dv1["KeyFieldName"], Node); tn.SetValue(treeListColumn1, dv1["NodeName"]); tn.Tag = dv1; GetCentralChild(dt,tn, Convert.ToInt16(dv1["KeyFieldName"])); } } private void GetCentralChild(DataTable dt, TreeListNode tn, int p) { DataView dv = new DataView(dt); dv.RowFilter = "ParentFieldName=" + p; if (dv.Count < 1) return; foreach (DataRowView dv1 in dv) { TreeListNode tns = tn.TreeList.AppendNode(dv1["KeyFieldName"], tn); //TreeListNode tn = treeList1.AppendNode(dv1["KeyFieldName"], Node); tns.SetValue(treeListColumn1, dv1["NodeName"]); tns.Tag = dv1; GetCentralChild(dt, tns, Convert.ToInt16(dv1["KeyFieldName"])); } }
DevExpress TreeList利用递归绑定数据,布布扣,bubuko.com
标签:des style blog color 数据 for ar div
原文地址:http://www.cnblogs.com/huangzhenhua/p/3886451.html