DataGridViewCell::GetValue Method (Int32)
.NET Framework (current version)
Gets the value of the cell.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Parameters
- rowIndex
-
Type:
System::Int32
The index of the cell's parent row.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | The value of the DataGridView property of the cell is not null and rowIndex is less than 0 or greater than or equal to the number of rows in the parent DataGridView. |
| InvalidOperationException | The value of the DataGridView property of the cell is not null and the value of the ColumnIndex property is less than 0, indicating that the cell is a row header cell. |
Pass the GetValue method the row index you used to retrieve the DataGridViewCell. Do not use the RowIndex property for the rowIndex parameter. If the row is shared, RowIndex is -1, which is not a valid value for rowIndex.
.NET Framework
Available since 2.0
Available since 2.0
Show: