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

RAD Spreadsheet access cells from code behind

1 Answer 372 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Julie
Top achievements
Rank 1
Julie asked on 21 Jun 2018, 05:45 PM
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

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 25 Jun 2018, 12:45 PM
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.


Regards,
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.
Tags
Spreadsheet
Asked by
Julie
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or