How to detect active sheet has changed

Sandra Walters

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.)

Alex Gyoshev

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.

David M

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.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.