DataGridViewCell.SetValue(Int32, Object) DataGridViewCell.SetValue(Int32, Object) DataGridViewCell.SetValue(Int32, Object) DataGridViewCell.SetValue(Int32, Object) Method

定義

設定儲存格的值。Sets the value of the cell.

protected:
 virtual bool SetValue(int rowIndex, System::Object ^ value);
protected virtual bool SetValue (int rowIndex, object value);
abstract member SetValue : int * obj -> bool
override this.SetValue : int * obj -> bool
Protected Overridable Function SetValue (rowIndex As Integer, value As Object) As Boolean

參數

rowIndex
Int32 Int32 Int32 Int32

儲存格的父資料列索引。The index of the cell's parent row.

value
Object Object Object Object

要設定的儲存格值。The cell value to set.

傳回

如果已經設定這個值,則為 true,否則為 falsetrue if the value has been set; otherwise, false.

例外狀況

rowIndex 小於 0 或是大於或等於父 DataGridView 中的資料列數。rowIndex is less than 0 or greater than or equal to the number of rows in the parent DataGridView.

適用於

另請參閱