This is a migrated thread and some comments may be shown as answers.

How to bind custom NewFile command for Spreadsheet RadRibbonButton

2 Answers 96 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Tomasz
Top achievements
Rank 1
Tomasz asked on 03 Dec 2013, 08:20 AM
Hi,
just like in topic, could You help me with binding my custom command to NewFile button ? 
The thing I want to achieve is: 
  1. (my custom code) Display question box for user: 'You sure want to create new file?"
  2. trigger base NewFile command functionality (clear sheet)

Thanks for help in advance ! 

2 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 03 Dec 2013, 02:28 PM
Hello Tomasz,

Thank you for your interest in RadSpreadsheet!

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 if this message 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!

Regards,
Deyan
Telerik
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 >>
0
Tomasz
Top achievements
Rank 1
answered on 06 Dec 2013, 08:05 AM
Hi again ;) 

Thanks for such professional answer.It all works well. 

Greetings,
Tomasz Gawlik

Tags
Spreadsheet
Asked by
Tomasz
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Tomasz
Top achievements
Rank 1
Share this question
or