How post changes before calling DataAdapter.Update?

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

I have a DataGrid bound to a DataTable. If the user makes changes to a
row and does not move off of that row before I call DataAdapter.Update
the changes are not made to the database. How, in code, can I post the
changes to the current row to the underlying DataTable so that calling
DataAdapter.Update will update the database?

Note that I have tried calling DataGrid.EndEdit and that does not work.
I have also tried calling CurrencyManager.EndCurrentEdit and that does
not work. The only thing that does work is changing the value of
CurrencyManager.Postion to move to another row, however, that does not
work when there is only one row in the table.

This should be easy so I must be missing something.
 
Bill,

Yeah, DataGrids are finicky like that. You found that the
CurrencyManager.EndCurrentEdit() will not work unless you change the
CurrencyManager.Position, but I've discovered that it *will* work is if the
user has moved off of the column.

There's probably some other way to handle this, but I don't work with Grids
much and since no one else was answering, I thought I'd at least throw in
that little tidbit of information. I know it's not too helpful though. =(

~~Bonnie
 
Back
Top