Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.MyDataSet1.MyDataTable.AddMyDataTableRow("11", "aaa") Me.MyDataSet1.MyDataTable.AddMyDataTableRow("12", "bbb") Me.MyDataSet1.MyDataTable.AddMyDataTableRow("13", "ccc") Me.MyDataSet1.MyDataTable.AddMyDataTableRow("14", "ddd") End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Me.MyDataSet1.MyDataTable(2).DataColumn2 = "NewText" End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Dim rowView = TryCast(ComboBox1.SelectedItem, DataRowView) If rowView IsNot Nothing Then Dim row = DirectCast(rowView.Row, MyDataSet.MyDataTableRow) rowView.BeginEdit() row.DataColumn2 = "内容の変更" rowView.EndEdit() End If End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click If ComboBox1.SelectedIndex <> -1 Then ComboBox1.SelectedItem("DataColumn2") = "レイトバインドで変更" ComboBox1.SelectedItem.EndEdit() End If End Sub Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click If BindingSource1.Position <> -1 Then BindingSource1.Current("DataColumn2") = "BindingSource側から編集" BindingSource1.EndEdit() End If End Sub