Unplanned
Last Updated: 23 Mar 2020 16:53 by ADMIN
Holly
Created on: 05 May 2016 15:58
Category: Spreadsheet
Type: Feature Request
2
Add ability to set the active sheet programmatically for the Spreadsheet
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!
1 comment
ADMIN
Peter Milchev
Posted on: 23 Mar 2020 16:53

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

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.