DataGridView.UpdateCellErrorText(Int32, Int32) 方法

定義

強制位於指定位置的儲存格更新其錯誤文字。

public:
 void UpdateCellErrorText(int columnIndex, int rowIndex);
public void UpdateCellErrorText (int columnIndex, int rowIndex);
member this.UpdateCellErrorText : int * int -> unit
Public Sub UpdateCellErrorText (columnIndex As Integer, rowIndex As Integer)

參數

columnIndex
Int32

要更新之儲存格的資料行索引,-1 則表示資料列行首儲存格。

rowIndex
Int32

要更新之儲存格的資料列索引,-1 則表示資料行行首儲存格。

例外狀況

columnIndex 小於 -1,或大於控制項中的資料行數目減 1。

-或-

rowIndex 小於 -1,或大於控制項中的資料列數目減 1。

備註

當您藉由處理 事件來維護儲存格錯誤文字時, CellErrorTextNeeded 請使用這個方法。 當您變更指定儲存格的預存錯誤文字時,請呼叫這個方法。 這會使儲存格失效,強制 DataGridView 控制項透過 CellErrorTextNeeded 事件處理常式擷取更新的錯誤文字。

雖然您可以使用這個方法來更新標頭儲存格的錯誤,但資料行標頭儲存格不會顯示錯誤字元。

適用於

另請參閱