It would be very handy if we could set the active sheet of the spreadsheet programmatically, either from the client-side or server-side. We'd like to be able to load a spreadsheet and select a certain tab as the initial active sheet without the user having to click on it or having to have that tab be the first in the list. Thank you!
The sheets can be activated via the API of the underlying Kendo UI Spreadsheet widget. Generally, the RadSpreadsheet is a wrapper of the Kendo UI Spreadsheet widget, so internally, you have a Kendo Spreadsheet, which you can access via the .get_kendoWidget() method.
Option 1.1:
function OnClientClicked(sender, args) {
var spreadsheet = $find("<%= RadSpreadsheet1.ClientID %>");
var kendoSpreadsheet = spreadsheet.get_kendoWidget();
var sheet = spreadsheet.findSheetByName("Sheet2");
var kendoSheet = sheet._sheet;
kendoSpreadsheet.activeSheet(kendoSheet);
}
Option 1.2:
function OnClientClicked(sender, args) {
var spreadsheet = $find("<%= RadSpreadsheet1.ClientID %>");
var kendoSpreadsheet = spreadsheet.get_kendoWidget();
var sheet = spreadsheet.findSheetByIndex(1);
var kendoSheet = sheet._sheet;
kendoSpreadsheet.activeSheet(kendoSheet);
}
Option 2.1:
function OnClientClicked(sender, args) {
var spreadsheet = $find("<%= RadSpreadsheet1.ClientID %>");
var kendoSpreadsheet = spreadsheet.get_kendoWidget();
var kendoSheet = kendoSpreadsheet.sheetByName("Sheet2");
kendoSpreadsheet.activeSheet(kendoSheet);
}
Option 2.2:
function OnClientClicked(sender, args) {
var spreadsheet = $find("<%= RadSpreadsheet1.ClientID %>");
var kendoSpreadsheet = spreadsheet.get_kendoWidget();
var kendoSheet = kendoSpreadsheet.sheetByIndex(1);
kendoSpreadsheet.activeSheet(kendoSheet);
}
Regards,
Peter Milchev
Progress Telerik