Hi
I asked this question some weeks ago, but have found no soluion yet, so I
try again
I have a parent detail relationship between two tables.
The detail records are shown in a datagrid (GridRemarks)
It is databound like this
GridRemarks.Dat asource = mainDatasource ' a shortcut to
myDataSet.tblPe rsons.DefaultVi ew
GridRemarks.Dat aMember ="tblPersons_tb lRemarks" ' The name of the parent
detail relation
And it works fine
THE PROBLEM: But before I save I would like to end the current edits.
So I tried like this
Dim bmRemarks As BindingManagerB ase = BindingContext( mainDataSource,
"tblPersons_tbl Remarks")
bmRemarks.EndCu rrentEdit()
And like this
Me.BindingConte xt(GridRemarks. DataSource,
GridRemarks.Dat aMember).EndCur rentEdit()
But to no avail.
I do not get any errors. It just does not end the current edit.
And my Dataset.HasChan ges test is (of course) negative
Now I have tried to write code like this:
Dim myDataGridCell As DataGridCell = Me.GridRemarks. CurrentCell
Dim bm As BindingManagerB ase = _
BindingContext( Me.GridRemarks. DataSource, Me.GridRemarks. DataMember)
Dim drv As DataRowView = CType(bm.Curren t, DataRowView)
Debug.WriteLine ("Værdi: " & drv(myDataGridC ell.ColumnNumbe r))
Debug.WriteLine ("Row: " & myDataGridCell. RowNumber)
And it works fine and writes the correct values to the debug window
So I guess the bindingmanagerb ase is correct. It just will not end the
currentedit
Any suggestions?
TIA
Jan