DataGridViewCellStyle::BackColor Property

 

Gets or sets the background color of a DataGridView cell.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
property Color BackColor {
	Color get();
	void set(Color value);
}

Property Value

Type: System.Drawing::Color

A Color that represents the background color of a cell. The default is Empty.

The following code example sets the background color of cells in the DataGridView by setting the BackColor property on the DefaultCellStyle property. Note that the background color is overridden on alternating rows because the BackColor property is set on the AlternatingRowsDefaultCellStyle property. This code example is part of a larger example provided for the DataGridViewCellStyle class.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: