DataGridViewRow.GetState(Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳一個表示該列當前狀態的值。
public:
virtual System::Windows::Forms::DataGridViewElementStates GetState(int rowIndex);
public virtual System.Windows.Forms.DataGridViewElementStates GetState(int rowIndex);
abstract member GetState : int -> System.Windows.Forms.DataGridViewElementStates
override this.GetState : int -> System.Windows.Forms.DataGridViewElementStates
Public Overridable Function GetState (rowIndex As Integer) As DataGridViewElementStates
參數
- rowIndex
- Int32
列的索引。
傳回
一個位元組合 DataGridViewElementStates 的數值,表示列狀態。
例外狀況
該列已被加入控制 DataGridView 項,但該 rowIndex 值不在有效範圍內,即 0 的控制項列數減 1。
備註
此方法有助於判定共用列的狀態。 共享列的值為 Index -1,這會阻止你在共享列中使用該 State 屬性。 使用此方法時,先傳入實際的列索引。 你可以透過呼叫該 IndexOf 方法來取得共享資料列的實際索引。