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

Create Workbook and Display

1 Answer 203 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Bernie
Top achievements
Rank 1
Bernie asked on 11 May 2020, 03:17 PM

I'm just getting started with the spreadsheet features. I need to create a blank workbook, make some modifications to it, and then display it in the spreadsheet control.

I've gotten this far

theWorkBook = new Telerik.Windows.Documents.Spreadsheet.Model.Workbook();

Telerik.Windows.Documents.Spreadsheet.Model.Worksheet theWorkSheet = theWorkBook.Worksheets.Add();         

theWorkSheet.Cells[0, 0].SetValue("1");

 

RadSpreadsheet1.Provider = ???????theWorkBook);

So I've created the book and added a sheet, modified a cell, and now I want to display it in the grid. What is the syntax to display my sheet in the RadSpreadSheet?

 

Thanks!

 

1 Answer, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 14 May 2020, 07:57 AM

Hello Bernie,

I am sharing the solution from the support thread for convenience and better visibility from the community:

You can convert the DPL workbook to an AJAX one and then just pass the sheets from the workbook to the Spreadsheet, without the need for any Provider. For more information about that, check the following articles:

RadSpreadsheet1.Sheets.AddRange(Telerik.Web.Spreadsheet.Workbook.FromDocument(theWorkBook).Sheets);

Regards,
Peter Milchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Spreadsheet
Asked by
Bernie
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Share this question
or