473,466 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Datagrid EndCurrentEdit problem...

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
2 1813
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dav | last post by:
I have a Winform with a derived datagrid and a button that adds a row to the datagrid in its Click event. The button has a shortcut text "&New Row". When I enter a value in a datagrid cell and...
6
by: BFX | last post by:
Hi All, I have datagrid with binding on dataset this.grdMachineType.DataMember = "MachineTypes"; this.grdMachineType.DataSource = this.dsMachineTypes; After append new row in datagrid i...
0
by: Junkguy | last post by:
I need to be able to tell if the blank row of a DataGrid has been edited or not. In a DataGrid, you may notice that if you click on the asterisk row, the asterisk will change to a triangle, but...
2
by: ChrisM | last post by:
Can anyone please tell me what I'm doing wrong here. I have a Windows Form with a DataGrid on it, and I'm having real problems with the Sorting. It is easy to reproduce the problem I have. If...
20
by: MadCrazyNewbie | last post by:
Hey group, I keep getting the following error: "An unhandled exception of type 'System.IndexOutOfRangeException' occurred in system.data.dll Additional information: There is no row at...
3
by: elziko | last post by:
I have a DataTable bound to a DataGrid. When a user clicks on a row on the DataGrid I use: MyDataTable.Rows(MyDatagrid.CurrentRowIndex).Item(0) to do some work with the value in the first cell...
0
by: Jan Nielsen | last post by:
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...
6
by: Jan Nielsen | last post by:
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...
1
by: Agnes | last post by:
my datagrid is bind to the table, I need to check clear when the user didn't input the figure. my code list as follow. when the datagrid got less then 100 tables, the code works, However, when it...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.