Export (0) Print
Expand All
Expand Minimize

DataGridViewCell.GetInheritedStyle Method

Note: This method is new in the .NET Framework version 2.0.

Gets the style applied to the cell.

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

public virtual DataGridViewCellStyle GetInheritedStyle (
	DataGridViewCellStyle inheritedCellStyle,
	int rowIndex,
	bool includeColors
)
public DataGridViewCellStyle GetInheritedStyle (
	DataGridViewCellStyle inheritedCellStyle, 
	int rowIndex, 
	boolean includeColors
)
public function GetInheritedStyle (
	inheritedCellStyle : DataGridViewCellStyle, 
	rowIndex : int, 
	includeColors : boolean
) : DataGridViewCellStyle

Parameters

inheritedCellStyle

A DataGridViewCellStyle to be populated with the inherited cell style.

rowIndex

The index of the cell's parent row.

includeColors

true to include inherited colors in the returned cell style; otherwise, false.

Return Value

A DataGridViewCellStyle that includes the style settings of the cell inherited from the cell's parent row, column, and DataGridView.

Exception typeCondition

InvalidOperationException

The cell has no associated DataGridView.

-or-

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

ArgumentOutOfRangeException

rowIndex is less than 0, or greater than or equal to the number of rows in the parent DataGridView.

This method returns a DataGridViewCellStyle that inherits its settings from the DataGridViewCellStyle objects of the cell's parent row, column, and DataGridView. For more information, see Cell Styles in the Windows Forms DataGridView Control.

Windows 98, Windows 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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft