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

Save method

3 Answers 350 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Claudia
Top achievements
Rank 1
Claudia asked on 09 May 2017, 03:23 PM

GoodMornig,

I'm using RadSpreadsheet in Aspx page with SpreadsheetDocumentProvider and an Excel file.

I have create a javascript that call the save method. I write it below

function exportFile() {
var spreadsheet = $find("<%= RadSpreadsheet1.ClientID %>");
spreadsheet.save();
         }

 

Is there a post save event ( client or server side) that I can Intercept?

I would like get the file saved on server and send it to client.

Many thanks

Claudia

 

 

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 11 May 2017, 01:35 PM

Hi Claudia,

You could create a custom content provider where you need to implement the Save method: http://docs.telerik.com/devtools/aspnet-ajax/controls/spreadsheet/data-binding/providers/custom-database-provider.

Alternatively, you can save the file on the client by using the underlying Kendo Spreadsheet widget directly with JavaScript: http://docs.telerik.com/kendo-ui/api/javascript/ui/spreadsheet#methods-saveAsExcel. Something like:

$telerik.$("#<%=RadSpreadsheet1.ClientID%>").data("kendoSpreadsheet").saveAsExcel();


Regards,

Marin Bratanov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Aaron
Top achievements
Rank 1
answered on 30 Jul 2020, 03:10 PM
I have implemented a custom provider, but the code is never called.  I don't understand where the disconnect is, as the call is supposed to be done through the control itself.

0
Peter Milchev
Telerik team
answered on 31 Jul 2020, 09:03 AM

Hello Aaron,

When the built-in Save button in the Spreadsheet toolbar is clicked, a callback is fired which calls the SaveWorkbook method of the CustomProvider assigned to the Spreadsheet. 

If the code is not hitting the provider, probably there is a JavaScript error or a failing request. Please inspect the Console and Network tabs of the browser's DevTools:

Another option is to detach the custom provider from the Spreadsheet and serialize and transfer the data manually on postback as demonstrated below:

Regards,
Peter Milchev
Progress Telerik

Tags
Spreadsheet
Asked by
Claudia
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Aaron
Top achievements
Rank 1
Peter Milchev
Telerik team
Share this question
or