//呵呵,界面设计器给我生成的代码如下
 
this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
 
 
//我改造后如下
 
this.dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

本文转载:CSDN博客