C# DataGridView 标题栏背景颜色改变

1  CylinderConditionDataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.Yellow;
2  CylinderConditionDataGridView1.RowHeadersDefaultCellStyle.BackColor = Color.Yellow;

除此之外,还需要改变控件的EnableHeadersVisualStyles为False,否则代码无效。