首页  ·  知识 ·  云计算
向DevExpress.TreeList控件中添加Column
网友    综合  编辑:dezai   图片来源:网络

1、添加引用

using DevExpress.XtraTreeList;
using DevExpress.XtraTreeList.Columns;

2、清除已有Columns

this.treelist.Columns.Clear();

3、添加代码

TreeListColumn tc1 = new TreeListColumn();
tc1.Caption = "图书编号";
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;

TreeListColumn tc5 = new TreeListColumn();
tc5.Caption = "作者";
tc5.VisibleIndex = 4;

TreeListColumn tc6 = new TreeListColumn();
tc6.Caption = "出版社";
tc6.VisibleIndex = 5;

TreeListColumn tc7 = new TreeListColumn();
tc7.Caption = "册数";
tc7.VisibleIndex = 6;

this.treelist.Columns.AddRange(new TreeListColumn[] { tc1,tc2,tc3,tc4,tc5,tc6,tc7 } );
 

本文作者:网友 来源:网络
CIO之家 www.ciozj.com 微信公众号:imciow
   
免责声明:本站转载此文章旨在分享信息,不代表对其内容的完全认同。文章来源已尽可能注明,若涉及版权问题,请及时与我们联系,我们将积极配合处理。同时,我们无法对文章内容的真实性、准确性及完整性进行完全保证,对于因文章内容而产生的任何后果,本账号不承担法律责任。转载仅出于传播目的,读者应自行对内容进行核实与判断。请谨慎参考文章信息,一切责任由读者自行承担。
延伸阅读