(for those of you who don't know it, the code used to fill a Flexgrid is here).

Al42, I'm afraid I dont see the purpose of an array as you described - it seems like a wasted step (but I may have read it wrong!).


Anyway, back to the question.. The main problem you have is in identifying the rows in the grid that have been edited (or added/deleted), and refering them back to the rows in the database.

To do this you will need to keep track somehow of the rows edited/added/removed. Presumably you will be using code at each point of the process (as the Flexgrid does not allow editing by default), so you can store the relevant information - possibly in arrays (or collections, or ...). When you want to update the database, refer to these to find out which rows you need to work with.

To ensure you are working with the right rows in the database, I would recommend changing the "fill" code, so that it also sets the RowData property for each row - using a unique (numerical) field in the database table. When you are doing the actual writing to the database, retrieve this value and use it as appropriate in Update/Insert/Delete SQL statements.