Share via


DataGridViewButtonCell.UseColumnTextForButtonValue 속성

정의

셀에 표시되는 단추에 소유하고 있는 열의 텍스트가 나타나는지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property bool UseColumnTextForButtonValue { bool get(); void set(bool value); };
public bool UseColumnTextForButtonValue { get; set; }
member this.UseColumnTextForButtonValue : bool with get, set
Public Property UseColumnTextForButtonValue As Boolean

속성 값

Boolean

Value 속성 값이 소유하고 있는 열의 Text 속성 값과 자동으로 일치하면 true이고, 그렇지 않으면 false입니다. 기본값은 false입니다.

예제

다음 코드 예제에서는이 멤버를 사용 하는 방법을 보여 줍니다.

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(0, buttonColumn);
}
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(0, buttonColumn)

End Sub

설명

FormattedValue 단추 셀의 텍스트가 단추에 표시됩니다. 이 UseColumnTextForButtonValue 속성을 사용하면 각 셀의 단추 텍스트를 설정하거나 모든 단추 셀에 부모 열의 속성 값을 사용할 Text 수 있습니다.

설정 합니다 UseColumnTextForButtonValue 소유 열의 속성을 설정 합니다 UseColumnTextForButtonValue 속성 새로 고침 및 열에 있는 모든 셀의 열을 표시 합니다. 열 값을 설정 하면 개별 셀에 대해 지정된 된 값을 재정의 하려면 셀 값을 설정 합니다.

적용 대상

추가 정보