RAD Spreadsheet access cells from code behind

2 posts, 0 answers
  1. Julie
    Julie avatar
    2 posts
    Member since:
    Apr 2018

    Posted 21 Jun 2018 Link to this post

    I have a radspreadsheet control that I bound from the server to an existing spreadsheet.  What I would like to know is can I update the cells on the spreadsheet with values from the code behind.  And if so, how do I go about doing it.  All of the examples are added a new worksheet and not updating an existing one
  2. Marin Bratanov
    Marin Bratanov avatar
    4901 posts

    Posted 25 Jun 2018 Link to this post

    Hi Julie,

    The default file system provider of the spreadsheet control takes a and excel file from the server and serializes it to the browser where the user can see and work with it in RadSpreadsheet. So, if you modify the file on the server, the next time a control instance requests that file, it will get the updated data. You can see this in action in our demos that you can download and run locally from your account, for example this one: https://demos.telerik.com/aspnet-ajax/spreadsheet/examples/overview/defaultcs.aspx.

    If you want to display to the user something different than what the file contains, you would need to create a custom provider that will implement the desired loading and saving logic: https://docs.telerik.com/devtools/aspnet-ajax/controls/spreadsheet/data-binding/providers/custom-database-provider.

    You can also administer changes in the browser through the client-side API of the control: https://docs.telerik.com/devtools/aspnet-ajax/controls/spreadsheet/client-side-programming/objects/spreadsheetrange. If you have a client-side event (e.g., fired by SignalR) that holds information about new cell values and their location, you can use that to update the user's current view. Note that this may result in data loss because you cannot guarantee that they have not changed some of those cells already.

    Marin Bratanov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top