I have an issue and a question. My application uses an XML database and is having a problem adding and saving records. A new record is created by getting a new row from the existing dataset and then immediately adding the row to the dataset's table collection and accepting the changes. At this point I would expect the row to have an index/count of n+1; it doesn't and will generate an error if accessed as n+1. Then, since the dataset is bound to a datagrid/datview on the UI, the record at position n+1 is displayed for the user to make changes.
Now the problem. The record displayed is not the new one. I've a few different things including sorting the data to force the dataview to place the new record at the end of the dataset where I expect it. This doesn't work. How do I get this to work? An easier approach would be to make my changes to the new record before it is added to the dataset, but that presents problems due to the architecture of the app.