Skip to content

Implement the ISpreadsheetCommandFactoryService interface to substitute the default command with your own custom command.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/winforms-spreadsheet-replace-standard-command-with-custom-command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spreadsheet for WinForms - Replace Standard SpreadsheetControl Commands with Custom Commands

This example illustrates the technique used to modify the functionality of existing SpreadsheetControl commands.

Implementation Details

The SpreadsheetControl exposes the ISpreadsheetCommandFactoryService interface that enables you to substitute the default command with your own custom command.

  1. Create a custom command class, inherited from the command that you wish to replace. Override the required methods of the command.

  2. Create a class inherited from the SpreadsheetCommandFactoryServiceWrapper, intended to substitute a default command service. In this class, override the CreateCommand method to create an instance of a custom command class, an identifier of the currently processed command is passed as a parameter of this method.

  3. Use the SpreadsheetCommandFactoryServiceWrapper class descendant to substitute the default command service.

Files to Review

Documentation

About

Implement the ISpreadsheetCommandFactoryService interface to substitute the default command with your own custom command.

Topics

Resources

License

Stars

Watchers

Forks