○VB.net DataGridの内容を動的に読み書き
デバッグウインドウにDataGridの内容がそのまま表示されます。
'0から始まる横の行数
Dim width As Integer = DataGrid1.Controls.Count() - 3
'0から始まる縦の行数
Dim height As Integer = dataTable1.Rows.Count - 1
Dim h As Integer
For h = 0 To height
Dim w As Integer
For w = 0 To width
Dim str As String = CType(DataGrid1.Item(h, w), String)
Debug.Write(str + " ")
Next
Debug.WriteLine("")
Next
▼このようにすると値が書き込めます
DataGrid1.Item(1, 1) = "aaa"