DataGridViewRow.ReadOnly 속성

정의

행이 읽기 전용인지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 virtual property bool ReadOnly { bool get(); void set(bool value); };
[System.ComponentModel.Browsable(true)]
public override bool ReadOnly { get; set; }
[<System.ComponentModel.Browsable(true)>]
member this.ReadOnly : bool with get, set
Public Overrides Property ReadOnly As Boolean

속성 값

Boolean

행이 읽기 전용이면 true이고, 그렇지 않으면 false입니다.

특성

예외

행이 DataGridView 컨트롤 안에 있고 공유 행인 경우

예제

다음 코드 예제에서는 클래스의 DataGridViewBand.ReadOnly DataGridViewRow 속성과 거의 동일한 ReadOnly 속성을 사용하는 방법을 보여 줍니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 DataGridViewBand 클래스입니다.

// Make the entire DataGridView read only.
void Button8_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   System::Collections::IEnumerator^ myEnum = dataGridView->Columns->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      DataGridViewBand^ band = safe_cast<DataGridViewBand^>(myEnum->Current);
      band->ReadOnly = true;
   }
}
// Make the entire DataGridView read only.
private void Button8_Click(object sender, System.EventArgs e)
{
    foreach (DataGridViewBand band in dataGridView.Columns)
    {
        band.ReadOnly = true;
    }
}
' Make the entire DataGridView read only.
Private Sub Button8_Click(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles Button8.Click

    For Each band As DataGridViewBand In dataGridView.Columns
        band.ReadOnly = True
    Next
End Sub

설명

이 속성은 ReadOnly 행에 DataGridViewCell.ReadOnly 있는 각 셀의 속성에 영향을 줍니다.

속성의 DataGridView.ReadOnly 값이 이 속성인 경우 이 속성을 true설정해도 아무 효과가 없습니다.

적용 대상

추가 정보