<Button Content="Undo" ig:Commanding.CommandTarget="{Binding ElementName=xamSpreadsheet1}"> <ig:Commanding.Command> <igPrim:SpreadsheetCommandSource EventName="Click" CommandType="Undo" /> </ig:Commanding.Command> </Button>
This topic explains how to configure and perform undo and redo operations with the control.
The following table lists the concept and topics required as a prerequisite to understanding this topic.
This topic contains the following sections:
The XamSpreadsheet control uses the Infragistics Undo/Redo Framework to provide robust undo and redo support for the changes made by the user. The control tracks all changes made to the associated workbook and populates the UndoManager.
"Undo" and "Redo" operations are triggered via the following:
The user presses a specific key combination while the XamSpreadsheet has focus. For example, Ctrl + Z triggers an Undo operation while Ctrl + Y triggers a Redo operation.
Invoking the Undo and Redo commands (see code snippets below)
Calling the following methods
XamSpreadsheet .UndoManager.Undo
XamSpreadsheet .UndoManager.Redo
The following table explains briefly the task which may be programmatically executed related to the undo and redo operations.
You can enable or disable the undo/redo support of the control using the IsUndoEnabled
property.
The redo operation incrementally backs out the changes inserted by the undo operation, pops the undo operation record off the redo history stack and adds it to the top of the undo history stack.
In XAML:
<Button Content="Undo" ig:Commanding.CommandTarget="{Binding ElementName=xamSpreadsheet1}"> <ig:Commanding.Command> <igPrim:SpreadsheetCommandSource EventName="Click" CommandType="Undo" /> </ig:Commanding.Command> </Button>
The redo operation incrementally backs out the changes inserted by the undo operation, pops the undo operation record off the redo history stack and adds it to the top of the undo history stack.
In XAML:
< Button Content="Redo" ig:Commanding.CommandTarget="{Binding ElementName=xamSpreadsheet1}"> <ig:Commanding.Command> <igPrim:SpreadsheetCommandSource EventName="Click" CommandType="Redo" /> </ig:Commanding.Command> </Button>
The following topics provide additional information related to this topic.