纸上得来终觉浅,绝知此事要躬行。

 

2011年1月12日

winForm下改变DataGridView的某行某列的值和控制列的位置

摘要: 控制DataGrieView的某列的位置可以这样做:this.dataGridView1.Columns["OperType"].DisplayIndex=5;则OperType列的位置就是在第6列上。DisplayIndex的索引是从0开始的。如果改变DataGridView的某行某列的值则可以这样做:[代码]       //以下两行分别是设置列标头居中和单元格内数据居中 this.dgv_serverLRRecord.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; this.dgv_serve 阅读全文

posted @ 2011-01-12 11:19 JRoger 阅读(4509) 评论(0) 推荐(1) 编辑

导航