DevExpress的TreeList

wzswxl 2013-05-06 01:21:47
各位大神,小弟刚用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这列没有数据??


...全文
100 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧