This is a migrated thread and some comments may be shown as answers.

Save changes from spreed sheets

1 Answer 202 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Mohamed
Top achievements
Rank 1
Mohamed asked on 03 May 2016, 09:43 AM

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

1 Answer, 1 is accepted

Sort by
0
Nikolay Demirev
Telerik team
answered on 04 May 2016, 08:45 AM
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.

Regards,
Nikolay Demirev
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
Spreadsheet
Asked by
Mohamed
Top achievements
Rank 1
Answers by
Nikolay Demirev
Telerik team
Share this question
or