Version

Working with Clipboard (UltraSpreadsheet)

Purpose

This topic explains how to perform clipboard operations.

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.

In this topic

This topic contains the following sections:

Clipboard Introduction

Clipboard summary

The UltraSpreadsheet’s control provides Cut, Copy and Paste clipboard operations allowing the user to copy information between cells, worksheets and even from and to external sources like another instance of the UltraSpreadsheet control or MS Excel.

Cut and Copying

When coping information to the clipboard the control supports the following formats:

  • BIFF8

  • CSV (comma separated values)

  • TSV (tab separated values)

There is also an internal format used when copying information to the clipboard and it is used when copying information between two instances of the UltraSpreadsheet control.

Pasting

When pasting information in the UltraSpreadsheet the control is updating the worksheet cells depending on the formats present in the clipboard. When pasting simple text (for example from Notepad), the text is treated as tab separated values and applied to the cells relative to the upper left cell of the selection similar to how MS Excel performs that operation. The UltraSpreadsheet will attempt to parse the value for each cell to try to determine the numeric value of the string and infer the number format for the cell similar to what is done when editing a cell.

Note
Note

When pasting simple text with merged cells completely within the target range will be unmerged.

Restrictions

The clipboard support feature of the UltraSpreadsheet has the following restrictions:

  • One may not select overlapping ranges but one can select multiple ranges that share the same top row or first column and have the same height or width (for example "B2:C3,E2:G3,B7:C9,E7:G9").

  • Some formats (for example text/csv) will just copy the cells that represent the union of these areas into the clipboard but others (such as the internal format used for copying/pasting within a UltraSpreadsheet) will only copy the selected cells.

  • When selecting columns/rows, only the intersection of those selected columns/rows with some content (values or formatting) will be copied to the clipboard.

Code Example: Invoking a Command

Description

The following code snippet shows how to invoke a clipboard command on the UltraSpreadsheet control using a button. The code snippet assumes you have a reference to an UltraSpreadsheet instance named "UltraSpreadsheet1".

Code

Following is the code that implements this example.

In C#:

private void ultraButton1_Click(object sender, EventArgs e)
{
   ultraSpreadsheet1.PerformAction(UltraSpreadsheetAction.Paste);
}

In VB:

Private Sub ultraButton1_Click(sender As Object, e As EventArgs) Handles UltraButton1.Click
 ultraSpreadsheet1.PerformAction(UltraSpreadsheetAction.Paste);
End Sub

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.

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