DataGridViewHeaderCell.GetInheritedState(Int32) 方法

定义

返回一个值,该值指示单元格的当前状态继承自其行或列的状态。

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

如果单元格不是行标题单元格或不包含在控件中 DataGridView ,则为包含单元格或 -1 行的索引。

返回

表示单元格的当前状态的值的 DataGridViewElementStates 按位组合。

例外

该单元格是行标题单元格,单元格不包含在控件中 DataGridViewrowIndex 并且不是 -1。

-或-

该单元格是行标题单元格,单元格包含在控件中 DataGridView ,并且 rowIndex 超出控件中行数减 1 的有效范围为 0。

-或-

该单元格是行标题单元格, rowIndex 不是包含此单元格的行的索引。

该单元格是列标题单元格或控件的TopLeftHeaderCellrowIndex,不是 -1。

适用于

另请参阅