-
datagrid
i have two forms, one called main, which has the dataset,bindingsource,bindingnavigator,tableadapter. then i have another form called view, which also has a dataset,bindingsource and a navigator.
when i go to the view form to choose a record i want to delete lets say record 6, i go to a form which displays the contents of the record like below;
Private Sub CHANGEREC_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ans = InputBox(" enter the song number you want to edit ! ")
artedit.Text = main.MusicDataSet.Tables("records").Rows(ans).Item(0)
songedit.Text = main.MusicDataSet.Tables("records").Rows(ans).Item(1)
yredit.Text = main.MusicDataSet.Tables("records").Rows(ans).Item(2)
changenew.Show()
End Sub
then i execute the delete part as here;
Private Sub Btnaccept_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnaccept.Click
If MessageBox.Show(" ARE THE CHANGES CORRECT ? " & vbCr & artedit.Text & vbCr & songedit.Text, " Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = System.Windows.Forms.DialogResult.Yes Then
main.BindingSource1.EndEdit()
main.RecordsTableAdapter.Update(main.MusicDataSet.records) 'updates the dataset
main.MusicDataSet.AcceptChanges()
Me.Close()
main.Show()
End If
End Sub
but the changes are not changed when i go back to the datagridview form. the contents are still the same. is the problem with having two forms with the same datasets, although they are bound together, should they not update the main one.
and why does the content not chnage in the datagrid view.
thanks
chaza