找回密码
 注册 (请使用非IE浏览器)
搜索
查看: 6863|回复: 3

求助 treeList1 绑定数据源后 数据怎么不显示

[复制链接]

0

精华

0

贡献

1

赞扬

回帖
3
软币
127
在线时间
8 小时
注册时间
2014-2-25
发表于 2014-4-9 14:55:50 | 显示全部楼层 |阅读模式
private void CreatTreeList()
        {
            TreeListColumn tc1 = new TreeListColumn();
            tc1.Caption = "权限ID";
            tc1.VisibleIndex = 0;
            TreeListColumn tc2 = new TreeListColumn();
            tc2.Caption = "父权限";
            tc2.VisibleIndex = 1;
            TreeListColumn tc3 = new TreeListColumn();
            tc3.Caption = "权限名称";
            tc3.VisibleIndex = 2;
            TreeListColumn tc4 = new TreeListColumn();
            tc4.Caption = "权限描述";
            tc4.VisibleIndex = 3;
            this.treeList1.Columns.AddRange(new TreeListColumn[] { tc1, tc2, tc3, tc4, });

            DataSet mydata = AuthorityInfo.GetAllTabel("Tb_PerRigth");
            treeList1.Nodes.Clear();
            DataTable table = mydata.Tables[0];
            this.treeList1.DataSource = table;
            this.treeList1.KeyFieldName = "tt_id";
            this.treeList1.RefreshDataSource();
        } [img]file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\617204565\QQ\WinTemp\RichOle\S9[PPWXA`KHJS_SO_Q%O}}4.jpg[/img]

QQ图片20140409145529.jpg
回复

使用道具 举报

0

精华

0

贡献

0

赞扬

回帖
1
软币
56
在线时间
0 小时
注册时间
2016-10-23
发表于 2016-10-23 12:19:22 | 显示全部楼层
应该还有parentid的p绑定
回复

使用道具 举报

0

精华

490

贡献

776

赞扬

管理员

回帖
93
软币
3936
在线时间
583 小时
注册时间
2015-6-30
发表于 2016-11-20 00:17:11 | 显示全部楼层
TreeListColumn 没有设置FiledName,把数据源的字段名对应设置
回复

使用道具 举报

0

精华

0

贡献

784

赞扬

回帖
103
软币
1674
在线时间
109 小时
注册时间
2017-8-2
发表于 2024-2-21 17:24:20 | 显示全部楼层
Thanks for Sharing.
回复

使用道具 举报

本版积分规则

Archiver|手机版|小黑屋|开发者网 ( 苏ICP备08004430号-2 )
版权所有:南京韵文科技有限公司 苏公网安备32011302322501号

GMT+8, 2026-2-21 17:35

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表