I am attaching a demo project on how to achieve the described scenario. A few words about this demo:
The project contains a UserControl with RadSpreadsheet and three buttons.
"Custom New File Command" button executes the custom command that shows a confirm message and ifthismessage is confirmed the default command gets executed.
"Default New File Command" button is bound to the default RadSpreadsheet command.
"Save changes" marks the UserControl's custom boolean property DocumentContentChanged as false and this way you custom command may not show the confirm message (if this is the desired behavior when user has just saved the file).
In order to listen for changes in current document we are attaching to the WorkbookContentChanged event. This is where DocumentContentChanged property is set to true. Additionally you may notice that we have set custom value to Workbook.WorkbookContentChangedInterval in order to make sure this event is not executed too often when the user makes changes to the document.
I hope this is helpful! If you have any other questions or concerns please do not hesitate to contact us again!
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely. Sign up for Free application insights >>