Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DataGridViewAdvancedBorderStyle Class

Contains border styles for the cells in a DataGridView control.


Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)
type DataGridViewAdvancedBorderStyle =  
        interface ICloneable 

The DataGridViewAdvancedBorderStyle type exposes the following members.

Public methodDataGridViewAdvancedBorderStyleInitializes a new instance of the DataGridViewAdvancedBorderStyle class.
Public propertyAllGets or sets the border style for all of the borders of a cell.
Public propertyBottomGets or sets the style for the bottom border of a cell.
Public propertyLeftGets the style for the left border of a cell.
Public propertyRightGets the style for the right border of a cell.
Public propertyTopGets the style for the top border of a cell.
Public methodEqualsDetermines whether the specified object is equal to the current DataGridViewAdvancedBorderStyle. (Overrides Object.Equals(Object).)
Public methodGetHashCodeServes as the default hash function. (Overrides Object.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns a string that represents the DataGridViewAdvancedBorderStyle. (Overrides Object.ToString().)
Explicit interface implemetationPrivate methodICloneable.CloneCreates a new object that is a copy of the current instance.

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 DataGridViewAdvancedBorderStyle 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 DataGridViewAdvancedBorderStyle 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 DataGridViewAdvancedBorderStyle objects to modify individual cell borders.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.