DataGridView.Item[] Özellik
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Belirtilen satır ve sütunun 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. |
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 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.
- Cells
- DataGridViewCellCollection
- Rows
- DataGridViewRowCollection
- DataGridView Denetimi (Windows Forms)
Şunlara uygulanır
.NET Framework 4.8 ve diğer sürümler
Ü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 |
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 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.
- Cells
- DataGridViewCellCollection
- Rows
- DataGridViewRowCollection
- DataGridView Denetimi (Windows Forms)
Şunlara uygulanır
.NET Framework 4.8 ve diğer sürümler
Ü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 |