Version

Working with Undo and Redo (UltraSpreadsheet)

Purpose

This topic explains how to configure and perform undo and redo operations with the control.

Required background

The following table lists the concept and topics required as a prerequisite to understanding this topic.

Type Content

Concept

Infragistics Excel Engine

Topic Purpose

In this section you will find information that will help you to better understand the object model and the functionalities of the Infragistics Excel Engine .

This topic explains in details the features of the UltraSpreadsheet control from developer perspective.

This topic provides an overview of the visual elements of the UltraSpreadsheet control.

Undo and Redo Configuration Summary

Undo and Redo configuration summary

The UltraSpreadsheet 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.

Note
Note

Each UltraSpreadsheet control uses its own UndoManager instance. You can also use the same UndoManager across multiple UltraSpreadsheet instances by setting this instance to the UndoManager property.

"Undo" and "Redo" operations are triggered via the following:

  • The user presses a specific key combination while the UltraSpreadsheet has focus. For example, Ctrl + Z triggers an Undo operation while Ctrl + Y triggers a Redo operation.

  • Invoking the Undo and Redo actions (see code snippets below)

  • Calling the following Manager

Undo and Redo configuration summary chart

The following table explains briefly the task which may be programmatically executed related to the undo and redo operations.

Task Details Property/ Action

Undo and Redo operations are enabled by default

Perform an undo operation

Undo

Perform a redo operation

Redo

Enable or Disable Undo and Redo Support

Overview

You can enable or disable the undo/redo support of the control using the IsUndoEnabled property.

Property settings

In order to: Use this property: And set it to:

Enable undo operation on a specific UltraSpreadsheet instance.

IsUndoEnabled

true

Disable undo operation on a specific UltraSpreadsheet instance.

IsUndoEnabled

false

Invoke Undo Operation

Overview

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.

Property settings

In order to: Instantiate the following command source: And set the following properties:

Perform the Undo operation on a specific UltraSpreadsheet instance.

SpreadsheetCommandSource

EventName

CommandType

Method settings

In order to: Perform the following method: Set the desired enumerated value:

Perform the Undo operation on a specific UltraSpreadsheet instance.

PerformAction

UltraSpreadsheetAction.Undo

Example

In C#:

ultraSpreadsheet1.PerformAction(UltraSpreadsheetAction.Undo);

In VB:

ultraSpreadsheet1.PerformAction(UltraSpreadsheetAction.Undo)

Invoke Redo Operation

Overview

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.

Property settings

In order to: Instantiate the following command source: And set the following properties:

Perform the Redo operation on a specific UltraSpreadsheet instance.

SpreadsheetCommandSource

EventName

CommandType

Method settings

In order to: Perform the following method: Set the desired enumerated value:

Perform the Redo operation on a specific UltraSpreadsheet instance.

PerformAction

UltraSpreadsheetAction.Redo

Example

In C#:

ultraSpreadsheet1.PerformAction(UltraSpreadsheetAction.Redo);

In VB:

ultraSpreadsheet1.PerformAction(UltraSpreadsheetAction.Redo)

Related Content

The following topics provide additional information related to this topic.

Topic Purpose

This topic explains the activation feature from developer perspective.

This topic explains the selection feature from developer perspective.