Datagrid EndCurrentEdit problem...

  • Thread starter Thread starter Jan Nielsen
  • Start date Start date
J

Jan Nielsen

Hi
I have a parent detail relationship between two tables.
The detail records are shown in a datagrid (GridRemarks)
It is databound like this

GridRemarks.Datasource = mainDatasource ' a shortcut to
myDataSet.tblPersons.DefaultView
GridRemarks.DataMember ="tblPersons_tblRemarks" ' The name of the parent
detail relation

And it works fine
But before I save I would like to end the current edits.
So I tried like this

Dim bmRemarks As BindingManagerBase = BindingContext(mainDataSource,
"tblPersons_tblRemarks")
bmRemarks.EndCurrentEdit()

And like this
Me.BindingContext(GridRemarks.DataSource,
GridRemarks.DataMember).EndCurrentEdit()

But to no avail.
I do not get any errors. It just does not end the current edit.

Any suggestions?

TIA

Jan
 
Jan,

Have you tried this?

Dim gridCurrencyManager As CurrencyManager = _
CType(Me.BindingContext(GridRemarks.DataSource, _
GridRemarksDataMember), CurrencyManager)
gridCurrencyManager.EndCurrentEdit()

--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com
 
Hi Mike
Thanks for answering.
I have now, and it did not make any difference.

Best regards

Jan
 
Back
Top