Getting values entered in cells from the server side

4 posts, 1 answers
  1. NMA
    NMA avatar
    2 posts
    Member since:
    Dec 2014

    Posted 24 Feb Link to this post

    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.
  2. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 25 Feb Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. NMA
    NMA avatar
    2 posts
    Member since:
    Dec 2014

    Posted 26 Feb in reply to Nencho Link to this post

    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.
  5. Answer
    Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 29 Feb Link to this post

    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
Back to Top