I have been trying to follow the Building an N-Tier Application in .NET
Technical Article that Paul Sheriff wrote. I am having trouble, however,
with one particular aspect and I was wondering if you could help me.
The problem centers around bound controls on the Client application. If you
place a TextEdit box and bind it using the DataBindings.Add method:
edtFirstName.DataBindings.Add(new Binding(“Text”, mdsEmps,
“Employees.FirstName”) this is C-Sharp code, by the way.
Now, as I type in the edtFirstName control and I click on the Update button,
the if mdsEmps.HasChanges fails. If, however, I click on the next row of the
datagrid, moving the record pointer, then I click on Update, then the test
succeeeds.
In other languages, the moving of the record pointer automatically performs
a Post on the dataset. Is there a command like this in .NET? If so, I have
not been able to find one. The row state remains unchanged until you move
off of it.
I am also wondering if I need to put the row into Edit mode somehow. I
appreciate any help you can give in this matter.
Sijin Joseph - 13 Oct 2004 05:18 GMT
The changes will commit to the datasource only after you move focus away
from the control. If you want to commit changes earlier you will have to
override the control and call EndCurrentEdit() on BindingManagerBase for
the control.
Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
> I have been trying to follow the Building an N-Tier Application in .NET
> Technical Article that Paul Sheriff wrote. I am having trouble, however,
[quoted text clipped - 17 lines]
> I am also wondering if I need to put the row into Edit mode somehow. I
> appreciate any help you can give in this matter.
WhiskyRomeo - 21 Feb 2005 23:23 GMT
I have this exact problem also. Changing the focus away from the control
does not help. You have to change records. I execute . . .
Me.BindingContext(dsClients, "tblClient").EndCurrentEdit()
and still get the failure. Yet GetChanges works.
My problems is I have a from that only displays one record at a time so
there is no other record to move to and since "EndCurrentEdit" doesn't work I
am stuck.
Any addtional insights would be appreciated.
WR
> The changes will commit to the datasource only after you move focus away
> from the control. If you want to commit changes earlier you will have to
[quoted text clipped - 26 lines]
> > I am also wondering if I need to put the row into Edit mode somehow. I
> > appreciate any help you can give in this matter.