By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,903 Members | 1,410 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,903 IT Pros & Developers. It's quick & easy.

Datagrid EndCurrentEdit problem...

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
"Jan Nielsen" <Re**************@tiscali.dk> wrote in message
news:eY**************@tk2msftngp13.phx.gbl...
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

Nov 21 '05 #2

P: n/a
Hi Mike
Thanks for answering.
I have now, and it did not make any difference.

Best regards

Jan

"Mike McIntyre" <mi****@dotnetshowandtell.com> skrev i en meddelelse
news:ui*************@TK2MSFTNGP12.phx.gbl...
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
"Jan Nielsen" <Re**************@tiscali.dk> wrote in message
news:eY**************@tk2msftngp13.phx.gbl...
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


Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.