Using Undo and Redo
Spread WinRT Documentation > Developer's Guide > Managing the User Interface > Using Undo and Redo

You can use Ctrl + Z to undo an action in the control. You can then use Ctrl + Y to redo the action you canceled.

You can undo the following types of actions:

The following actions do not respond to Ctrl + Z:

You can prevent or allow the undo action in code with the CanUserUndo property.

Using Code

This example sets the CanUserUndo property and creates a group.

CS
Copy Code
private void Grid_Loaded_1(object sender, RoutedEventArgs e)
{
gcSpreadSheet1.CanUserUndo = true;
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
GrapeCity.Xaml.SpreadSheet.UI.UndoRedo.RowGroupExtent group = new GrapeCity.Xaml.SpreadSheet.UI.UndoRedo.RowGroupExtent(3, 5);
GrapeCity.Xaml.SpreadSheet.UI.UndoRedo.RowGroupUndoAction action = new GrapeCity.Xaml.SpreadSheet.UI.UndoRedo.RowGroupUndoAction(this.gcSpreadSheet1.ActiveSheet, group);
this.gcSpreadSheet1.DoCommand(action);
}
VB
Copy Code
Private Sub MainPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded       
gcSpreadSheet1.CanUserUndo = True 
End Sub
Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
Dim group As New GrapeCity.Xaml.SpreadSheet.UI.UndoRedo.RowGroupExtent(3, 5)
Dim action As New GrapeCity.Xaml.SpreadSheet.UI.UndoRedo.RowGroupUndoAction(gcSpreadSheet1.ActiveSheet, group)
gcSpreadSheet1.DoCommand(action)
End Sub
See Also