DataGridViewCell.GetValue(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the value of the cell.
protected:
virtual System::Object ^ GetValue(int rowIndex);
protected virtual object GetValue (int rowIndex);
protected virtual object? GetValue (int rowIndex);
abstract member GetValue : int -> obj
override this.GetValue : int -> obj
Protected Overridable Function GetValue (rowIndex As Integer) As Object
Parameters
- rowIndex
- Int32
The index of the cell's parent row.
Returns
The value contained in the DataGridViewCell.
Exceptions
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.
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.
Remarks
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
.
Applies to
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈