DataGridViewButtonCell::GetValue Method (Int32)

 

Retrieves the text associated with the button.

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

protected:
virtual Object^ GetValue(
	int rowIndex
) override

Parameters

rowIndex
Type: System::Int32

The index of the cell's parent row.

Return Value

Type: System::Object^

The value of the DataGridViewButtonCell or the Text value of the owning column if UseColumnTextForButtonValue is true.

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.

.NET Framework
Available since 2.0
Return to top
Show: