Articles in this section
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,

Set the background color to GridControl

Figure 1: Setting the backcolor for the Grid

 

Samples:

C#: BackGround color_for_grid

VB: BackGround color_for_grid

 


Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied