Export (0) Print
Expand All

DataGridViewCell.InheritedStyle Property

Gets the style currently applied to the cell.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public DataGridViewCellStyle InheritedStyle { get; }
/** @property */
public DataGridViewCellStyle get_InheritedStyle ()

public function get InheritedStyle () : DataGridViewCellStyle

Not applicable.

Property Value

The DataGridViewCellStyle currently applied to the cell.

Exception typeCondition

InvalidOperationException

The cell does not belong to a DataGridView control.

-or-

ColumnIndex is less than 0, indicating that the cell is a row header cell.

ArgumentOutOfRangeException

The row containing the cell is a shared row.

-or-

The cell is a column header cell.

The DataGridView control displays its cells using the styles indicated by the cell InheritedStyle property, which inherits styles from other properties of type DataGridViewCellStyle. The styles specified through the Style property override the styles specified through all other cell-style properties, but do not necessarily indicate all the styles that contribute to the cell's appearance.

For more information, see Cell Styles in the Windows Forms DataGridView Control.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft