本帖最后由 amy_guoguo 于 2010-06-02 16:23:26 编辑

解决方案 »

  1.   

    row.DefaultCellStyle.BackColor = Color.Red
    CellPainting重写
      

  2.   

    datagridview
      

  3.   

    private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
    {
        if (e.ColumnIndex ==-1)
        {
            Graphics g= e.Graphics;
            g.FillRectangle(Brushes.Red,e.CellBounds);//红色
            e.Handled = true;//记住加上这句
        }
    }
      

  4.   

    dataGridView1.Columns[1].DefaultCellStyle.BackColor = Color.AliceBlue;
      

  5.   

    不用那么麻烦啊
    设置EnableHeadersVisualStyles =FALSE;
    就可以设置RowHeadersDefaultCellStyle的BackColor属性了
    例如:dataGridView1.RowHeadersDefaultCellStyle.BackColor = Color.Red;