Spreadsheet for ASP.NET Web Forms - How to save/load documents to/from a database
This example demonstrates how to configure the Spreadsheet control to work with a database.
Overview
During page initialization, load a document from a database as a byte array and pass it to the control's Open method to open the document in the Spreadsheet.
The Saving event occurs when a user clicks the built-in Save or SaveAs command in the Spreadsheet's Ribbon UI. To save changes, handle the Saving
event and update the data source. To save the document after a user clicks a custom button, update the database in the button's Click event handler.
Note
When a user changes a cell value, the Spreadsheet control applies the entered value only after the user moves focus to another cell. A new cell value cannot be saved until the control applies it. To apply the pending cell value change, call the ApplyCellEdit method.
Files to Review
- Default.aspx (VB: Default.aspx)
- Default.aspx.cs (VB: Default.aspx.vb)