整理来自于https://bbs.csdn.net/topics/350232824,https://heisetoufa.iteye.com/blog/239998
1.禁止用户调整行的高度(包括标题)
dataGridView1.AllowUserToResizeRows = false;
2.禁止用户调整列的宽度(包括标题)
dataGridView1.AllowUserToResizeColumns = false;
3.不显示最后一行(最下面的空行).
this.dataGridView1.AllowUserToAddRows = false;
4.获取指定单元的背景色.
dataGridView1.Row[0].Cells[0].Style.BackColor;
5.禁止编辑所有单元格.
dataGridView1.ReadOnly=true;