DataGridViewButtonColumn.UseColumnTextForButtonValue プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As DataGridViewButtonColumn Dim value As Boolean value = instance.UseColumnTextForButtonValue instance.UseColumnTextForButtonValue = value
/** @property */ public boolean get_UseColumnTextForButtonValue () /** @property */ public void set_UseColumnTextForButtonValue (boolean value)
public function get UseColumnTextForButtonValue () : boolean public function set UseColumnTextForButtonValue (value : boolean)
Text プロパティの値が列内のボタンに表示される場合は true。各セルの FormattedValue プロパティの値がボタンに表示される場合は false。既定値は false です。


既定では、ボタン セルの DataGridViewCell.FormattedValue がボタンのテキストとして表示されます。UseColumnTextForButtonValue プロパティを使用すると、各セルに対してボタン テキストを設定するか、Text プロパティの値をすべてのボタン セルに使用するかを決定できます。
このプロパティを取得または設定すると、CellTemplate プロパティによって返されるオブジェクトの UseColumnTextForButtonValue プロパティを取得または設定できます。このプロパティを設定すると、列に含まれるすべてのセルの UseColumnTextForButtonValue プロパティも設定され、列の表示が更新されます。各セルの指定した値をオーバーライドするには、列の値を設定してからセルの値を設定します。

Private Sub CreateUnboundButtonColumn() ' Initialize the button column. Dim buttonColumn As New DataGridViewButtonColumn With buttonColumn .HeaderText = "Details" .Name = "Details" .Text = "View Details" ' Use the Text property for the button text for all cells rather ' than using each cell's value as the text for its own button. .UseColumnTextForButtonValue = True End With ' Add the button column to the control. dataGridView1.Columns.Insert(1, buttonColumn) End Sub
private void CreateUnboundButtonColumn() { // Initialize the button column. DataGridViewButtonColumn buttonColumn = new DataGridViewButtonColumn(); buttonColumn.Name = "Details"; buttonColumn.HeaderText = "Details"; buttonColumn.Text = "View Details"; // Use the Text property for the button text for all cells rather // than using each cell's value as the text for its own button. buttonColumn.UseColumnTextForButtonValue = true; // Add the button column to the control. dataGridView1.Columns.Insert(1, buttonColumn); }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DataGridViewButtonColumn クラス
DataGridViewButtonColumn メンバ
System.Windows.Forms 名前空間
DataGridView クラス
DataGridViewButtonColumn.Text プロパティ
DataGridViewCell.FormattedValue
DataGridViewButtonColumn.CellTemplate プロパティ
DataGridViewButtonCell クラス
DataGridViewButtonCell.UseColumnTextForButtonValue プロパティ
その他の技術情報
方法 : Windows フォーム DataGridView コントロールのボタン列にあるボタンを無効にする
- DataGridViewButtonColumn.UseColumnTextForButtonValue プロパティのページへのリンク