DataGridViewButtonColumn::UseColumnTextForButtonValue Property
Gets or sets a value indicating whether the Text property value is displayed as the button text for cells in this column.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Property Value
Type: System::Booleantrue if the Text property value is displayed on buttons in the column; false if the FormattedValue property value of each cell is displayed on its button. The default is false.
| Exception | Condition |
|---|---|
| InvalidOperationException | The value of the CellTemplate property is null. |
By default, the DataGridViewCell::FormattedValue of a button cell is displayed as the 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 for all of the button cells.
Getting or setting this property gets or sets the UseColumnTextForButtonValue property of the object returned by the CellTemplate property. Setting this property 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.
Available since 2.0