Hello,
I have a problem whereby I have datagrid bound to a dataset with the following properties
I have put a similar problem up b4 but I still do not have an answer.
MyDatagrid.DataSource = Mydatase
MyDatagrid.DataMember = "Orders
MyDatagrid.SetDataBinding(Mydataset, "Orders"
I wish to update the backend dataset when the user makes a change to the dataset.My problem is that the
dataset does not recognise a change until the user clicks on the next row of the datagrid, except when th
user is on the first row of the datagrid
therefore in the MyDatagrid_currentcellchanged event I have the following code
Private Sub MyDataGrid_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Mydatagrid.CurrentCellChange
DirectCast(BindingContext(Mydataset.Tables("Orders ")), CurrencyManager).EndCurrentEdit(
If MyDataset.HasChanges The
Dim Mydataaccess As New DataAccess.DataAcces
Call Mydataaccess.UpdateDataSet(Mydataset, MyMetalWorkAdapter, "Metalwork"
End I
End I
End Su
My problem is that the Mydataset.HasChanges condition is only true after the user makes a change and then clicks on the nex
row of the grid, EXCEPT when on the first row of the grid, then Mydataset.haschanges = true on changing an individual colum
Does anyone know why this is happening, or how to resolve it so that updates are performed immediately upon changing a column, you can't expect the use
to click on the next row each time they make a change. Does anyone have a sample of a vb program whereby a datagrid is updated against a backend database
I can't imagine that this is such a rare occurrence
Thanx in Advanc
Geraldine