Can this control open, edit and save Excel File from Code. Open a File from code and not in Page_Init event.
If the Spreadsheet needs to be populated programmatically, there are two options:
using
System;
using
AJAX = Telerik.Web.Spreadsheet;
using
System.Collections.Generic;
public
partial
class
Default : System.Web.UI.Page
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
AJAX.Workbook ajaxWorkbook =
new
AJAX.Workbook();
AJAX.Worksheet ajaxWorksheet = ajaxWorkbook.AddSheet();
AJAX.Row row =
new
AJAX.Row() { Index = 2, Cells =
new
List<AJAX.Cell> { } };
row.AddCell(
new
AJAX.Cell() { Index = 2, Value =
"Test cell"
});
ajaxWorksheet.AddRow(row);
RadSpreadsheet1.Sheets.Add(ajaxWorksheet);
}
}
If an Excel file needs to be loaded manually, the DocumentProcessingLibrary can be used and then the DPL workbook can be converted to AJAX workbook and adding the sheets from the workbook to the RadSpreadsheet will do the job.