各位大神,小弟刚用DevExpress遇到一个问题如下:
界面上添加一个TreeList (treeList1),同时为TreeList添加一个列(treeListColumn1)
设置treeListColumn1.FieldName = "Name";
数据表DataTabl(dt),有三列"Id","Name","Description"
dt数据如下:
1,Name1,名字1
2,Name2,名字2
现在想将dt中的数据绑定到treeList1上,没有父节点。具体代码如下:
treeList1.DataSource = null;
treeList1.KeyFieldName = "Id";
treeList1.ParentFieldName = null;
treeList1.DataSource = dt;
treeList1.ExpandAll();
显示结果如图,为什么treeListColumn1这列没有数据??