Best Change Tracking Strategy to capture changes to cells and types of changes (adds, edits, deletes)?

Posted by: dkimzey on 8 September 2017, 2:59 pm EST

  • Posted 8 September 2017, 2:59 pm EST

    I have a case where I need to save spread data to a SQL Table via Entity Framework.  Since I am not trying to turn the Spread control into a grid view-but actually need the data as a spreadsheet, I am not binding the Spread control directly to an entity.  This would simply map each spreadsheet column to a entity (or SQL Table) column.

     Rather, I have derived a class from FpSpread in conjunction with a class derived from DefaultSheetDataModel to maintain a list of changes made to cells during a session. 

    This allows me to limit the number of updates applied to the database to the number of changed cells.  If I only change 10 out of 50,000 cells I only want ten transactions with the database.  I have had to do this as a combination of classes derived from DefaultSheetModel and FpSpread because the SheetDataModelEventArgs cover added cells, deleted cells and updated cells all under one blanket SheetDataModelEventType.CellsUpdated. 

    Several questions:

    1.  In a class derived from DefaultSheetDataModel, is there a way to determine the type of update (add, edit, delete) to a cell?

    2.   Is there a DefaultSheetDataModel.DataSource object type that would allow me to maintain a spreadsheet type interface (and not transform the Spread control into a column centric grid)?

    3. Can I capture the data for large spreadsheets including formulas and formatting in a performant manner to XML?



  • Replied 8 September 2017, 2:59 pm EST


    I would answer your queries in the same order:

    1. You can use the Changed event of the DefaultSheetDataModel, to keep a track of what kind of change has been actually done to a cell, as it is fired whenever a change is made to the cell. You would need to manually save and later compare the state of the cell to determine what kind of change is exactly made to it.

    2. I am not able to understand this query of yours, can you please elaborate the same further.

    3. Yes, you can save all the data in Spread to XML using the SaveXml method of Spread. Please refer to the following link that explains the same:


    Hope it will help you. Please let me know if you have any queries further.


    Manpreet Kaur

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels