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

DataGridViewElementStates 值的位元 (Bitwise) 組合,表示儲存格的目前狀態。

例外狀況

儲存格為資料列行首儲存格、儲存格未包含在 DataGridView 控制項內,且 rowIndex 不是 -1。

-或- 儲存格為資料列行首儲存格、儲存格包含在 DataGridView 控制項內,且 rowIndex 位於有效範圍之外 (有效範圍是從 0 到控制項的資料列數減 1 的範圍)。

-或- 儲存格為資料列行首儲存格,且 rowIndex 不是包含此儲存格的資料列之索引。

儲存格為資料行行首儲存格,或控制項的 TopLeftHeaderCellrowIndex 不是 -1。

適用於

另請參閱