摘要: 给datagridview绑定了一个List<T>的数据源,但是我仅仅想显示class T中的某几个属性怎么办,在网上查到了一下几种方法:方法一:设置AutoGenerateColumns = false;手动添加列,并把列的DataPropertyName属性设置为源中的类的对应属性的名方法二:将类中不想显示的属性加上属性(attitude): [System .ComponentModel .Browsable (false )]例如,我不想显示a属性,可以如此: [System.ComponentModel.Browsable(false)] public int... 阅读全文
posted @ 2012-01-05 23:42 果壳中的宇宙 阅读(2127) 评论(0) 推荐(1) 编辑