DataGridViewHeaderCell.GetInheritedState(Int32) DataGridViewHeaderCell.GetInheritedState(Int32) DataGridViewHeaderCell.GetInheritedState(Int32) DataGridViewHeaderCell.GetInheritedState(Int32) Method

定义

返回一个值,它指示单元格的当前状态为从它的行或列状态继承的状态。Returns a value indicating the current state of the cell as inherited from the state of its row or column.

public:
 override System::Windows::Forms::DataGridViewElementStates GetInheritedState(int rowIndex);
public override System.Windows.Forms.DataGridViewElementStates GetInheritedState (int rowIndex);
override this.GetInheritedState : int -> System.Windows.Forms.DataGridViewElementStates
Public Overrides Function GetInheritedState (rowIndex As Integer) As DataGridViewElementStates

参数

rowIndex
Int32 Int32 Int32 Int32

如果单元格不是一个行标头单元格,或者没有包含在 DataGridView 控件中,则为包含单元格的行的索引或为 -1。The index of the row containing the cell or -1 if the cell is not a row header cell or is not contained within a DataGridView control.

返回

DataGridViewElementStates 值的按位组合,表示单元格的当前状态。A bitwise combination of DataGridViewElementStates values representing the current state of the cell.

异常

单元格是一个行标头单元格,没有包含在 DataGridView 控件内,rowIndex 不是 -1。The cell is a row header cell, the cell is not contained within a DataGridView control, and rowIndex is not -1.

- 或 --or- 单元格是一个行标头单元格,包含在 DataGridView 控件内,rowIndex 在有效范围(0 到控件中的行数减 1 的差)以外。The cell is a row header cell, the cell is contained within a DataGridView control, and rowIndex is outside the valid range of 0 to the number of rows in the control minus 1.

- 或 --or- 单元格是一个行标头单元格,rowIndex 不是包含此单元格的行的索引。The cell is a row header cell and rowIndex is not the index of the row containing this cell.

单元格是一个列标头单元格或者控件的 TopLeftHeaderCellrowIndex 不是 -1。The cell is a column header cell or the control's TopLeftHeaderCell and rowIndex is not -1.

适用于

另请参阅