开发者论坛

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

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

[复制链接]

0

精华

0

贡献

1

赞扬

帖子
10
软币
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

贡献

727

赞扬

管理员

Rank: 45Rank: 45Rank: 45Rank: 45Rank: 45

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

使用道具 举报

0

精华

0

贡献

513

赞扬

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

使用道具 举报

Archiver|手机版|小黑屋|开发者网 ( 苏ICP备08004430号-2 )
版权所有:南京韵文教育信息咨询有限公司

GMT+8, 2024-3-29 03:11

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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