How to detect active sheet has changed

3 posts, 0 answers
  1. Sandra Walters
    Sandra Walters avatar
    29 posts
    Member since:
    Dec 2005

    Posted 06 May Link to this post

    Hello all,

    I'm looking for a way to detect that the user has selected a different sheet (tab) within the spreadsheet control.  There doesn't seem to be an event for this action.  Is there some other way to detect that the active sheet has been changed?

    As background - I'm working on an app for a client in which I've added the spreadsheet control, with several sheets.  There's no facility for a custom cell editor (such as a dropdown), but the client is adamant that they want one - they do not want their users typing directly in the cell, but rather, making a selection.  I thought a workaround might be to place a dropdown elsewhere on the page, then when the user makes a selection in it, apply the selected text to the currently selected cell on the active sheet.  However, I want to hide the dropdown unless the user is on the sheet to which the dropdown actually applies.  (I'm also open to any suggestions for a different workaround that doesn't require the user to type out the text themselves.) 

  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 09 May Link to this post

    Hello Sandra,

    At this time, there is not event triggered when the sheet is changed. You can submit this as a feature request on UserVoice, so that it is considered for implementation in a future release. As a workaround, you can bind to the spreadsheet render event and check if the activeSheet is the one you need to show the drop-down for.

    Regards,
    Alex Gyoshev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. David M
    David M avatar
    13 posts
    Member since:
    Jul 2015

    Posted 18 May Link to this post

    I've been looking into doing this same thing on specific cells, and the only thing I can think of currently is capturing the click using the "render" callback for the entire spreadsheet.  This function is called on almost everything because each click renders something, and if you add this with the "sheet.selection" method you can then dictate whether or not the "dropdown" cell has been selected, and therefore making the selection ui appear.  Then it's just up to using the range.value to edit the sheets data.  
Back to Top