C# DataGridView 第一列永不被选中

来源:互联网 发布:相对湿度计算软件 编辑:程序博客网 时间:2024/06/06 01:45

  方法很猥琐,很聪明,from:http://topic.csdn.net/u/20080731/14/daeaef55-0d6c-4e5b-b108-1c4b1f947f75.html

 

  dataGridView1.Columns[0].DefaultCellStyle.SelectionBackColor = Color.White;
  dataGridView1.Columns[0].DefaultCellStyle.SelectionForeColor = Color.Black;

 

  这样第一列就不会被选中了。