Contains border styles for the cells in a DataGridView control.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Thetype exposes the following members.
|Equals||Determines whether the specified object is equal to the current . (Overrides Object.Equals(Object).)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)|
|GetHashCode||Serves as a hash function for a particular type. (Overrides Object.GetHashCode().)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|ToString||Returns a string that represents the . (Overrides Object.ToString().)|
The DataGridView control allows you to fully customize its appearance, including the borders of the cells and headers. The DataGridView has CellBorderStyle, ColumnHeadersBorderStyle, and RowHeadersBorderStyle properties that allow you to set the appearance of the cell border. However, if you need to further customize the borders, the class allows you to set the style of the border on the individual sides of the cells. The Left, Right, Top, and Bottom properties of represent the left, right, top, and bottom border of a cell, respectively. You can set these properties on the AdvancedCellBorderStyle, AdvancedColumnHeadersBorderStyle, AdvancedRowHeadersBorderStyle properties of the DataGridView to produce various appearances for the borders between the cells.
The following code example adjusts the cell borders of a DataGridView so that a double border separates the interior cells and the top left header cell from the row and column headers. This sample demonstrates how to override the AdjustColumnHeaderBorderStyle, AdjustRowHeaderBorderStyle, and AdjustCellBorderStyle methods, and the AdjustedTopLeftHeaderBorderStyle property. These members use objects to modify individual cell borders.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2