DataGridViewButtonCell.GetValue(Int32) Method

Definition

Retrieves the text associated with the button.

protected:
 override System::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

Object

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.

Applies to

See also