Access the Spreadsheet workbook on the server
HOW TO
Access the Spreadsheet workbook on the server.
SOLUTION
When pressing the Save button in the Spreadsheet or calling programmatically the .save()
client-side method, you can access the Spreadsheet workbook on the server by using one of the following approaches:
- Use a Custom Provider and the Workbook will be available in the
SaveWorkbook
method. - Parse the
Request.Params["__CALLBACKPARAM"]
property value by using the.FromJson()
method of the staticTelerik.Web.Spreadsheet.Workbook
class. For example:
protected void Page_Load(object sender, EventArgs e)
{
if (IsCallback && Request.Params["__CALLBACKID"] == RadSpreadsheet1.UniqueID)
{
Workbook workbook = Telerik.Web.Spreadsheet.Workbook.FromJson(Request.Params["__CALLBACKPARAM"]);
}
}
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If IsCallback AndAlso Request.Params("__CALLBACKID") = RadSpreadsheet1.UniqueID Then
Dim workbook As Workbook = Telerik.Web.Spreadsheet.Workbook.FromJson(Request.Params("__CALLBACKPARAM"))
End If
End Sub