如何在DataGridView中设置coloumn背景颜色

我想知道在设计时我应该使用哪个属性来设置DataGridView表的列的背景颜色。我不想以编程方式进行。     
已邀请:
您必须将属性
EnableHeadersVisualStyles
设置为
false
才能使自定义设置正常工作。
this.myDgv.EnableHeadersVisualStyles = false;
this.myDgv.Columns[ 0 ].HeaderCell.Style.BackColor = Color.Red;
这应该工作。 //编辑:啊,你不想通过代码来做,但是generel方法也适用于设计师。属性
EnableHeadersVisualStyles
是DataGridView的直接属性,以及您在属性
ColumnHeadersDefaultCellStyle
中设置的列的颜色。     
右键单击DataGridView - > Edit Columns ...然后选择您的列,单击DefaultCellStyle。这将为您提供...按钮,单击它并根据需要设置样式。     

要回复问题请先登录注册