DataGridView.Item[] Özellik

Tanım

Belirtilen satır ve sütunun kesişiminde bulunan hücreyi almak veya ayarlamak için bir dizin oluşturucu sağlar.

Aşırı Yüklemeler

Item[Int32, Int32]

Belirtilen dizinlerle sütun ve satırın kesişiminde bulunan hücreyi almak veya ayarlamak için bir dizin oluşturucu sağlar.

Item[String, Int32]

Belirtilen dizine ve belirtilen ada sahip sütuna sahip satırın kesişiminde bulunan hücreyi almak veya ayarlamak için bir dizin oluşturucu sağlar.

Item[Int32, Int32]

Belirtilen dizinlerle sütun ve satırın kesişiminde bulunan hücreyi almak veya ayarlamak için bir dizin oluşturucu sağlar.

public:
 property System::Windows::Forms::DataGridViewCell ^ default[int, int] { System::Windows::Forms::DataGridViewCell ^ get(int columnIndex, int rowIndex); void set(int columnIndex, int rowIndex, System::Windows::Forms::DataGridViewCell ^ value); };
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.DataGridViewCell this[int columnIndex, int rowIndex] { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.Item(int * int) : System.Windows.Forms.DataGridViewCell with get, set
Default Public Property Item(columnIndex As Integer, rowIndex As Integer) As DataGridViewCell

Parametreler

columnIndex
Int32

Hücreyi içeren sütunun dizini.

rowIndex
Int32

Hücreyi içeren satırın dizini.

Özellik Değeri

DataGridViewCell

DataGridViewCell Belirtilen konumda.

Öznitelikler

Özel durumlar

columnIndex 0'dan küçük veya denetimdeki sütun sayısından eksi 1'den büyük.

-veya- rowIndex 0'dan küçük veya denetimdeki satır sayısı eksi 1'den büyük.

Örnekler

Aşağıdaki kod örneği, bu dizin oluşturucunun kullanımını gösterir.

// Retrieve the cell value for the cell at column 3, row 7.
String testValue1 = (String)dataGridView1[3, 7].Value;

// Retrieve the cell value for the cell in the Name column at row 4.
String testValue2 = (String)dataGridView1["Name", 4].Value;
' Retrieve the cell value for the cell at column 3, row 7.
Dim testValue1 As String = CStr(dataGridView1(3, 7).Value)

' Retrieve the cell value for the cell in the Name column at row 4.
Dim testValue2 As String = CStr(dataGridView1("Name", 4).Value)

Açıklamalar

Bu dizin oluşturucu, koleksiyonun koleksiyonu aracılığıyla hücrelere erişmeye Cells Rows alternatiftir.

Ayrıca bkz.

Şunlara uygulanır

Item[String, Int32]

Belirtilen dizine ve belirtilen ada sahip sütuna sahip satırın kesişiminde bulunan hücreyi almak veya ayarlamak için bir dizin oluşturucu sağlar.

public:
 property System::Windows::Forms::DataGridViewCell ^ default[System::String ^, int] { System::Windows::Forms::DataGridViewCell ^ get(System::String ^ columnName, int rowIndex); void set(System::String ^ columnName, int rowIndex, System::Windows::Forms::DataGridViewCell ^ value); };
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.DataGridViewCell this[string columnName, int rowIndex] { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.Item(string * int) : System.Windows.Forms.DataGridViewCell with get, set
Default Public Property Item(columnName As String, rowIndex As Integer) As DataGridViewCell

Parametreler

columnName
String

Hücreyi içeren sütunun adı.

rowIndex
Int32

Hücreyi içeren satırın dizini.

Özellik Değeri

DataGridViewCell

DataGridViewCell Belirtilen konumda.

Öznitelikler

Örnekler

Aşağıdaki kod örneği, bu dizin oluşturucunun kullanımını gösterir.

// Retrieve the cell value for the cell at column 3, row 7.
String testValue1 = (String)dataGridView1[3, 7].Value;

// Retrieve the cell value for the cell in the Name column at row 4.
String testValue2 = (String)dataGridView1["Name", 4].Value;
' Retrieve the cell value for the cell at column 3, row 7.
Dim testValue1 As String = CStr(dataGridView1(3, 7).Value)

' Retrieve the cell value for the cell in the Name column at row 4.
Dim testValue2 As String = CStr(dataGridView1("Name", 4).Value)

Açıklamalar

Bu dizin oluşturucu, koleksiyonun koleksiyonu aracılığıyla hücrelere erişmeye Cells Rows alternatiftir.

Ayrıca bkz.

Şunlara uygulanır