bound textbox update source

F

Frank

Hopefully this is the correct group for this message. My
previous post to (I assume) a non-.net group was not
welcomed.

I have a form with 7 text boxes that are all bound to
fields of a dataset. The form also contains a datagrid
also bound to the same dataset.

I have a button on the form to update the data to the
source.

1) If I change data in a row of the grid and hit the save
button it updates the source.

2) If I change data in a textbox and hit the button it
does not update the source although the cell on the
datagrid changes to the new value as soon as I exit the
textbox.

3) If I change the value in the textbox and then click
anywhere on the grid (not neccessarily on the applicable
row or cell) and then press the sabe button the source is
updated.

Any idea why the textbox only method 2) doesn't work?

Thanks.
 
O

One Handed Man [ OHM# ]

Try Updating the Database with the Update Method in the 'Leave' event for
one of the text boxes. Then alter the data and tab out of it, see if this
works.

Regards - OHM
 
F

Fitwedertubugter

Nope.
Only thing that works is if the datagrid gets focus before save button
pressed.
I even deleted the grid and left the text boxes - that didn't work either.
On the leave event of textbox I set focus to the grid and then back to the
next textbox. Only got a buffer overflow error.

Frank
 
O

One Handed Man [ OHM# ]

Look,
This needs to be debugged with method I think.

Trap the leave event of this text box and have it print out in the debug
window all the rows. This way you will at least see if your DataTable is
being updated with the new data in the textbox.

I dont have time to reconstruct this at the moment, but I would suggest that
if this does not work, you should repost in the ADONET newsgroup, this is
likely to yeild a fast response.

Regards - OHM
 
F

Frank

Thanks.
I took your advise and checked out ADONET group. It seems I am not the only
one to have this problem or a similar one.

The workaround was to put code just before the update action that would move
one position positive in the dataset and then one position negative then
call the udate. That way I am still on the same record after the update.
I am used to having to devise workarounds with this Microsoft stuff.
Thanks again.
 
C

Cor

Hi Frank,

Did you already look at the currencymanager.endcurrentedit ?

Maybe this wil resolve your problem.

Cor
 
F

Frank

I'm just learning this stuff and I couldn't figure out how to invoke
currencymanager but I did get this to work:

Me.BindingContext(DsVendors1, "Vendors").EndCurrentEdit()
Me.daVendors.Update(DsVendors1, "Vendors")

and it's cleaner than the workaround I had devised.

Thanks !!!
 

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