Gets or sets the color of the grid lines separating the cells of the DataGridView.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
You can set the property to any color when you use a single border; with other types of borders, the colors are specified by the operating system. If visual styles are enabled for the application through the Application.EnableVisualStyles method, the property is ignored, and the current theme's colors are used.
The following code example demonstrates how to set the ColumnHeadersDefaultCellStyle, AutoSizeRowsMode, ColumnHeadersBorderStyle, CellBorderStyle, , BackgroundColor, RowHeadersVisible, SelectionMode, ColumnCount, and MultiSelect properties. In addition, the code example demonstrates how to set the DataGridViewColumn.Name and DataGridViewColumn.DefaultCellStyle properties. To run this example, paste the code into a form that contains a DataGridView named dataGridView1, and then call the SetUpDataGridView method from the form's constructor or Load event handler. Ensure all events are associated with their event handlers.