DataGridViewButtonColumn.UseColumnTextForButtonValue 속성

정의

이 열의 셀에 대한 단추 텍스트로 Text 속성 값을 표시할지 여부를 나타내는 값을 가져오거나 설정합니다.

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

Text 속성 값이 열의 단추에 표시되면 true이고, 각 셀의 FormattedValue 속성 값이 해당 단추에 표시되면 false입니다. 기본값은 false입니다.

예외

CellTemplate 속성의 값이 null인 경우

예제

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

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

설명

기본적으로 DataGridViewCell.FormattedValue 단추 셀은 단추의 텍스트로 표시됩니다. 이 UseColumnTextForButtonValue 속성을 사용하면 각 셀의 단추 텍스트를 설정하거나 모든 단추 셀에 Text 대한 속성 값을 사용할 수 있습니다.

거사 설정 받기 또는이 속성을 설정 합니다 UseColumnTextForButtonValue 반환 하는 개체의 속성을 CellTemplate 속성입니다. 이 속성을 설정 집합을 UseColumnTextForButtonValue 속성 새로 고침 및 열에 있는 모든 셀의 열을 표시 합니다. 열 값을 설정 하면 개별 셀에 대해 지정된 된 값을 재정의 하려면 셀 값을 설정 합니다.

적용 대상

추가 정보