Share via


DataGridViewRow.ReadOnly Özellik

Tanım

Satırın salt okunur olup olmadığını belirten bir değer alır veya ayarlar.

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

Özellik Değeri

true satır salt okunursa; aksi takdirde , false.

Öznitelikler

Özel durumlar

Satır bir DataGridView denetimdedir ve paylaşılan bir satırdır.

Örnekler

Aşağıdaki kod örneği, sınıfının özelliğiyle DataGridViewBand.ReadOnly neredeyse aynı olan özelliğinin ReadOnlyDataGridViewRow nasıl kullanılacağını gösterir. Bu kod örneği, sınıfı için DataGridViewBand sağlanan daha büyük bir örneğin parçasıdır.

// 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

Açıklamalar

ReadOnly özelliği, satırdaki DataGridViewCell.ReadOnly her hücrenin özelliğini etkiler.

Özelliğin değeri ise truebu özelliğin ayarlanmasının DataGridView.ReadOnly hiçbir etkisi olmaz.

Şunlara uygulanır

Ayrıca bkz.