Datagrid EndCurrentEdit problem...

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
 
M

Mike McIntyre

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
 
J

Jan Nielsen

Hi Mike
Thanks for answering.
I have now, and it did not make any difference.

Best regards

Jan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top