DataGridViewCell.SetValue(Int32, Object) 方法

定义

设置单元格的值。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

该单元格的父行索引。The index of the cell's parent row.

value
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.

适用于

另请参阅