C
Colin Mackie
Appreciate any help with this one.
I have a DataRow loaded up from the database and the DataTable is bound to a
DataGrid.
However, I want to be able to change the data programmatically and only use
the DataGrid to display the current data. When a user double clicks a row, a
dialog show and allows them to make changes and I am using
"row.item(fieldname) = value" to set the data up. The row is changed,
DataAdapter saves it, and the grid updates. Great.
Now if I sort the grid on a column, so it's 'out of normal order', when the
"row.item(fieldname) = value" is called, the RowState remains as
Unchanged...even though I can see that the data has changed in its internal
array! So the DataAdapter doesn't write it away, and everything gets screwed
from there because the DataRow doesn't match the database.
I have had a look around and found some references to something similar and
suggesting calling row.EndEdit() or CurrencyManager.EndCurrentEdit(), but
this has no effect.
Any ideas???
Cheers,
Colin
I have a DataRow loaded up from the database and the DataTable is bound to a
DataGrid.
However, I want to be able to change the data programmatically and only use
the DataGrid to display the current data. When a user double clicks a row, a
dialog show and allows them to make changes and I am using
"row.item(fieldname) = value" to set the data up. The row is changed,
DataAdapter saves it, and the grid updates. Great.
Now if I sort the grid on a column, so it's 'out of normal order', when the
"row.item(fieldname) = value" is called, the RowState remains as
Unchanged...even though I can see that the data has changed in its internal
array! So the DataAdapter doesn't write it away, and everything gets screwed
from there because the DataRow doesn't match the database.
I have had a look around and found some references to something similar and
suggesting calling row.EndEdit() or CurrencyManager.EndCurrentEdit(), but
this has no effect.
Any ideas???
Cheers,
Colin