Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to replace standard SpreadsheetControl command with your own custom command

$
0
0

This example illustrates the technique used to modify the functionality of existing SpreadsheetControl commands.
The SpreadsheetControl exposes the ISpreadsheetCommandFactoryService interface that enables you to substitute the default command with your own custom command. 

First, create a custom command class, inherited from the command that you wish to replace. Override the required methods of the command. Then, create a class inherited from the SpreadsheetCommandFactoryServiceWrapper, intended to substitute a default command service. In this class, you need to 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. 

Finally, use the SpreadsheetCommandFactoryServiceWrapper class descendant to substitute the default command service.

In this case, instead of the default command, the command you implemented will be used by the SpreadsheetControl.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>