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

Getting values entered in cells from the server side

4 Answers 425 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
NMA
Top achievements
Rank 2
NMA asked on 24 Feb 2016, 07:45 AM
Hello,

I placed a RadSpreadsheet object in anaspx page as follows:

<telerik:RadSpreadsheet runat="server" ID="rssMain" Skin="Bootstrap" ColumnsCount="10">               
    <Toolbar>
        <telerik:SpreadsheetToolbarTab Text="Test"></telerik:SpreadsheetToolbarTab>                   
    </Toolbar>               
</telerik:RadSpreadsheet>

All I want to do is to collect what the user typed in several cells when the submit button on the same page is clicked. I should be able to access those values by traversing through rows and cells of the spreadsheet but the values cannot be accessed as expected.

Please note that I am not using any data source or whatsoever (no data binding). Just a blank spreadsheet to get user typed values on postback.

4 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 25 Feb 2016, 09:43 AM
Hi,

The reason for the inability to acquire the data at the page code behind is the fact that the RadSpreadsheet does not have ViewState. Due to this, data manipulations at the code behind are applicable only in a ReadOnly scenario.

In order to be able to access the newly filled data, you need to implement the CustomProvider and handle the overwritten SaveWorkbook method. Please refer to the following documentation article, describing in details the implementation of the CustomProvider:

http://docs.telerik.com/devtools/aspnet-ajax/controls/spreadsheet/data-binding/providers/custom-database-provider

Once the Save button from the toolbar is clicked, the SaveWorkbook method in the CustomProvider will be triggered and the newly data will be accessible.

Regards,
Nencho
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
NMA
Top achievements
Rank 2
answered on 26 Feb 2016, 09:04 AM
Is there a way to trigger click for the save button in the toolbar? Because I want to hide all buttons in the toolbar and as far as I understand, the save button should be clicked to preserve values before the postback.
0
Accepted
Nencho
Telerik team
answered on 29 Feb 2016, 02:43 PM
Hello Nurretin,

Yes, you need to invoke the Save, in order to trigger the method in the mentioned CustomProvider. You can use the Client Api of the control in the following manner:

Copy Code
var spread = $find("RadSpreadsheet1");
spread.save()

The above will trigger a call to the SaveWorkbook method in your Custom Provider.

In addition, I would like to ask you to continue the correspondence in the Support ticket that you have submitted, in order to avoid any further duplication.

Thank you in advance.


Regards,
Nencho
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Padmaraj
Top achievements
Rank 1
answered on 08 Mar 2017, 11:39 AM

Hi,

var spreadsheet = $find("RadSpreadsheet1");
spreadsheet.save();

I'm save event of spreadsheet from client side using following code above, but my custom provider SaveWorkBook is not getting called instead getting error as :

The type initializer for &#39;Telerik.Web.Spreadsheet.Workbook&#39; threw an exception.

Is there any configuration settings to be done in web.config file.

Tags
Spreadsheet
Asked by
NMA
Top achievements
Rank 2
Answers by
Nencho
Telerik team
NMA
Top achievements
Rank 2
Padmaraj
Top achievements
Rank 1
Share this question
or