本帖最后由 z_zhi 于 2013-04-11 10:21:02 编辑

解决方案 »

  1.   


    void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
            {
                e.CellStyle.BackColor =XXXX
            }
      

  2.   

    你可以先设定第n行为只读,再设定其前、背景色 DataGridViewRow row = this.dataGridView1.Rows[n];
                row.ReadOnly = true;
                row.DefaultCellStyle.BackColor = Color.Red;
                row.DefaultCellStyle.ForeColor = Color.Red;
      

  3.   

    我现在的界面是这样的:就是整个行都灰显、第一列的checkbox也不能勾选
      

  4.   

    你可能需要重绘这行中所有cell的颜色,同时处理一些鼠标键盘选择这个cell的事件,使其不可选中。Google: gray out datagridview