Databinding problem...changes in bound controls do not change Dataset.HasChanges to true.
Posted on 2003-12-11
I'm having a little trouble, I think relating to the DataSet.HasChanges and/or DataRow.RowState properties not reflecting changes made to a DataSet through DataBound TextBoxes on a windows form.
The form displays selected data (the DataSet is being filled successfully and the DataBindings are working). I edited the data through the TextBoxes and in debugging, the locals window shows those changes but the RowState remains Unchanged. So calling DataAdapter.Update() does nothing because the DataSet.HasChanges=false and DataRow.RowState=Unchanged.
Setting up this form using the Data Form Wizard seems to hook everything up correctly. Everything reads and writes as it should. But programmatically instantiating and filling the DataSet, defining the DataAdapter's commands, defining the controls' DataBindings, etc. causes this problem.
I set a breakpoint just after filling the DataSet initially, and just before calling DataAdapter.Update(). Both times the state properties of the DataSet reflected no change even though its data had changed.
What do I need to do to have the DataSet reflect its status accurately?