Save changes from spreed sheets

2 posts, 0 answers
  1. Mohamed
    Mohamed avatar
    2 posts
    Member since:
    May 2016

    Posted 03 May 2016 Link to this post

    Hi there!

    Now i have spreedsheet that gets its data from entity data base and  bind it to the page the question is :

    i have save button , So how can i save the data i inserted in the spreedsheet to the data base i tried some times but the data i entered in the spreed sheets is deleted automatically once i clicked on the button so i want to catch the cells i inserted or edited data on it and save the values of it in the data base

    Thanks in advance

  2. Nikolay Demirev
    Nikolay Demirev avatar
    136 posts

    Posted 04 May 2016 Link to this post

    Hello Mohamed,

    There are several events showing that something has changed. You have to use them in order to know what has changed in the Workbook. This way you will save only the specific changes in the database.

    Changing the worksheets collection:
    this.radSpreadsheet.Workbook.Sheets.Changed += this.Sheets_Changed;

    Some cell property is changed:
    this.radSpreadsheet.Workbook.ActiveWorksheet.Cells.CellPropertyChanged += this.Cells_CellPropertyChanged;

    Cell range is inserted or removed:
    this.radSpreadsheet.Workbook.ActiveWorksheet.Cells.CellRangeInsertedOrRemoved += this.Cells_CellRangeInsertedOrRemoved;

    Cells are merged or unmerged:
    this.radSpreadsheet.Workbook.ActiveWorksheet.Cells.MergedCellsChanged += this.Cells_MergedCellsChanged;

    If you want to save the entire document in the database you could use WorkbookContentChanged evet. This event is raised when something in the Workbook is changed. If multiple things are changed at once only one event will be triggered:
    this.radSpreadsheet.WorkbookContentChanged += this.radSpreadsheet_WorkbookContentChanged;
    If you are using WorkbookContentChanged event there is no information telling you what is changed that is why you have to iterate all worksheets and all used cells in each worksheet and save it in the database. In this help article, you can read more about how to get the used range for the entire worksheet or some of its properties.

    Nikolay Demirev
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top