DataGridViewButtonCell.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.
Retrieves the text associated with the button.
protected:
override System::Object ^ GetValue(int rowIndex);
protected override object GetValue (int rowIndex);
protected override object? GetValue (int rowIndex);
override this.GetValue : int -> obj
Protected Overrides Function GetValue (rowIndex As Integer) As Object
Parameters
- rowIndex
- Int32
The index of the cell's parent row.
Returns
The value of the DataGridViewButtonCell or the Text value of the owning column if UseColumnTextForButtonValue is true
.
Remarks
This method is useful to retrieve the text of a cell in a shared row, which cannot store cell values locally and remain shared. You must pass in the actual row index because shared rows have indexes of -1. For more information about row sharing, see Best Practices for Scaling the Windows Forms DataGridView Control.