Represents the formatting and style information applied to individual cells within a DataGridView control.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
The class lets you share style information across multiple DataGridView cells, rows, columns, and row or column headers, avoiding the memory requirements of setting style properties on individual cells. For more information about classes that have a property of type and how they relate to each other, see Cell Styles in the Windows Forms DataGridView Control.
The following code example demonstrates the effect of setting properties on multiple objects. This example sets the background color of cells in the DataGridView by setting the BackColor property on the DefaultCellStyle property. The background color is overridden on alternating rows because the BackColor property is set on the AlternatingRowsDefaultCellStyle property. The example also determines the format of dates in the column named Last Prepared by setting the Format property on the column's DefaultCellStyle property.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.