DataGridViewRow.Cells Özellik

Tanım

Satırı dolduran hücre koleksiyonunu alır.

C#
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.DataGridViewCellCollection Cells { get; }

Özellik Değeri

DataGridViewCellCollection

DataGridViewCellCollection Satırdaki tüm hücreleri içeren bir.

Öznitelikler

Örnekler

Aşağıdaki kod örneği, satırdaki Cells bir hücrenin değerini ayarlamak için özelliğini kullanır. Bu kod örneği, How to: Manipulate Rows in the Windows Forms DataGridView Control bölümünde sağlanan daha büyük bir kod örneğinin bir parçasıdır.

C#
// Give cheescake excellent rating.
private void Button8_Click(object sender,
    System.EventArgs e)
{
    UpdateStars(dataGridView.Rows[4], "******************");
}

int ratingColumn = 3;

private void UpdateStars(DataGridViewRow row, string stars)
{

    row.Cells[ratingColumn].Value = stars;

    // Resize the column width to account for the new value.
    row.DataGridView.AutoResizeColumn(ratingColumn, 
        DataGridViewAutoSizeColumnMode.DisplayedCells);
}

Açıklamalar

Bu özelliğe erişildiğinde satırda herhangi bir hücre yoksa, yöntemine CreateCellsInstance yapılan bir çağrı tarafından yeni bir boş DataGridViewCellCollection oluşturulur.

Şunlara uygulanır

Ürün Sürümler
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
Windows Desktop 3.0, 3.1, 5, 6, 7

Ayrıca bkz.