New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

RadSpreadsheet Object

This article explains the methods of the Radspreadsheet client-side object. The Radspreadsheet client API allows a complete control over the client object, giving the developer the opportunity to implement a preferable behavior depending on the custom scenario.

The following table lists the methods of the client-side RadSpreadsheet object:

NameParametersReturn TypeDescription
savenonenoneSaves the current data and layot of the Spreadsheet in the source Excel file.
saveAsExcelnonenoneExports the current data and layot of the Spreadsheet into an Excel file and promps you to download it in your browser.
get_activeSheetnoneSpreadsheetSheetReturns a reference to the active sheet. (see Example 1)
get_kendoWidgetnoneKendo SpreadsheetReturns a reference to the underlying Kendo Spreadsheet widget.
get_sheetsnoneArrayReturns an array of sheets contained in the Spreadsheet.
findSheetByNamestringSpreadsheetSheetReturns a reference to the sheet matching the specified name.(see Example 2)
findSheetByIndexintSpreadsheetSheetReturns a reference to the sheet by its index in the workbook. (see Example 3)
insertSheetnonenoneInserts an empty sheet in the Spreadsheet after the last one in the workbook.
removeSheetSpreadsheetSheetnoneRemoves the specified sheet from the workbook. (see Example 4)
renameSheetSpreadsheetSheet, stringnoneRenames the specified sheet with the specified text. (see Example 5)

Example 1: Demonstrates the usage of the get_activeSheet method

JavaScript

function getActiveSheet() {
    var spreadsheet = $find("<%= RadSpreadsheet1.ClientID %>");
    var activeSheet = spreadsheet.get_activeSheet();
}

Example 2: Demonstrates the usage of the findSheetByName method

JavaScript
function getSheetByName() {

    var spreadsheet = $find("<%= RadSpreadsheet1.ClientID %>");
	var sheet = spreadsheet.findSheetByName("Sheet1");    
}

Example 3: Demonstrates the usage of the findSheetByIndex method

JavaScript
function getSheetByIndex() {
    var spreadsheet = $find("<%= RadSpreadsheet1.ClientID %>");
    var sheet = spreadsheet.findSheetByIndex(0);
}

Example 4: Demonstrates the usage of the removeSheet method

JavaScript

function spreadsheetRemoveSheet() {
    var spreadsheet = $find("<%= RadSpreadsheet1.ClientID %>");
    var sheet = spreadsheet.findSheetByIndex(1);
    spreadsheet.removeSheet(sheet);
}

Example 5: Demonstrates the usage of the renameSheet method

JavaScript
function spreadsheetRenameSheet() {
    var spreadsheet = $find("<%= RadSpreadsheet1.ClientID %>");
    var sheet = spreadsheet.findSheetByIndex(1);
    spreadsheet.renameSheet(sheet, "MySheet");
}
Not finding the help you need?
Contact Support