Share via


DataGridViewRow.GetErrorText(Int32) 方法

定義

取得指定索引處之資料列的錯誤文字。

public:
 System::String ^ GetErrorText(int rowIndex);
public string GetErrorText (int rowIndex);
member this.GetErrorText : int -> string
Public Function GetErrorText (rowIndex As Integer) As String

參數

rowIndex
Int32

包含錯誤的資料列索引。

傳回

字串,描述在指定索引處的資料列錯誤。

例外狀況

資料列屬於 DataGridView 控制項而且是共用資料列。

這個資料列屬於 DataGridView 控制項,而且 rowIndex 小於零或大於控制項中的資料列數減一。

備註

GetErrorText傳遞您用來擷取的DataGridViewRow索引方法。 請勿將 Index 屬性用於 rowIndex 參數。 如果共享數據列, Index 則 為 -1,這是 的 rowIndex無效值。 如需數據列共用的詳細資訊,請參閱調整 dataGridView 控件 Windows Forms 最佳做法

適用於

另請參閱