DataGridViewButtonCell::UseColumnTextForButtonValue Property

 

Gets or sets a value indicating whether the owning column's text will appear on the button displayed by the cell.

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

public:
property bool UseColumnTextForButtonValue {
	bool get();
	void set(bool value);
}

Property Value

Type: System::Boolean

true if the value of the Value property will automatically match the value of the DataGridViewButtonColumn::Text property of the owning column; otherwise, false. The default is false.

The FormattedValue of a button cell is displayed as text on the button. The UseColumnTextForButtonValue property allows you to either set the button text for each cell, or to use the Text property value of the parent column for all of the button cells.

Setting the UseColumnTextForButtonValue property of the owning column also sets the UseColumnTextForButtonValue property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value.

The following code example demonstrates the use of this member.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: