Category / Section
How to set the background color for WinForms GridControl?
2 mins read
Background settings
To set the backcolor for the area of the Grid populated by cells, you must set the grid.BackColor property to the color. The backcolor for the client area of the Grid is set by the BackgroundColor property where there are no cells and no scrollbars.
C#
//set the backcolor for the grid gridControl1.BackColor = Color.LightGreen; //set the backcolor for the gridclient area gridControl1.Properties.BackgroundColor = Color.LightCyan;
VB
'set the backcolor for the grid gridControl1.BackColor = Color. LightGreen 'set the backcolor for the gridclient area gridControl1.Properties.BackgroundColor = Color. LightCyan
After applying the properties, the Grid is shown as follows,
Figure 1: Setting the backcolor for the Grid
Samples: