SetValue Method
TOC
Collapse the table of content
Expand the table of content

DataGridViewCell.SetValue Method (Int32, Object)

 

Sets the value of the cell.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

protected virtual bool SetValue(
	int rowIndex,
	object value
)

Parameters

rowIndex
Type: System.Int32

The index of the cell's parent row.

value
Type: System.Object

The cell value to set.

Return Value

Type: System.Boolean

true if the value has been set; otherwise, false.

Exception Condition
ArgumentOutOfRangeException

rowIndex is less than 0 or greater than or equal to the number of rows in the parent DataGridView.

InvalidOperationException

ColumnIndex is less than 0.

.NET Framework
Available since 2.0
Return to top
Show:
© 2016 Microsoft