Version

Automatic Repetitive Paste in Grids

This topic explains the WinGrid™ automatic repetitive paste functionality and provides a quick demo example of how this functionality works.

The topic is organized as follows:

Introduction

The WinGrid has basic copy/paste/undo features built-in. One of these built-in features mimics the behavior Microsoft Excel® has when pasting data to a selection of cells that is larger than the selection being copied. This behavior, called “repetitive paste”, repeats the pasted data as many times as the source (copied) selection of cells fits into the destination (paste) selection (Figure 1).

WinGrid Automatic Repetitive Paste in Grids 01.png
WinGrid Automatic Repetitive Paste in Grids 02.png

Figure 1: Selection of cells containing data that has been repetitively pasted.

Automatic Repetitive Paste – Conceptual Explanation

The WinGrid automatic repetitive paste functionality uses the size of the cell selection to determine if the selection is an exact multiple (in regards to the amount of row and column data in the clipboard). If the selection is an exact multiple, then the paste operation will repeat the same data throughout the selection as shown in Figure 1. If it isn’t, just one copy of the copied content will be pasted (normal Paste).

This behavior is exactly the same as exhibited by MS Excel.

Example

Let’s have the same data in our WinGrid as shown in Figure 1 along with clipboard operations enabled. (For information about how to turn clipboard operations on, please refer to the topic, Turn On Clipboard Operations.) We are going to paste it into a destination selection that is three times larger, in horizontal direction, than the area being copied. (Figure 3 below)

  1. Drag and highlight the area cells you want to copy.

  2. Press Ctrl-C to copy the values.

  3. Using another area of the grid, or another WinGrid, drag and highlight a selection of cells that is a multiple of the previously copied cells . For this example, if you copied 2 columns with 3 rows, you could use a selection of 6 columns and 3 rows because they are a multiple of your selection.

WinGrid Automatic Repetitive Paste in Grids 03.png

Figure 2: Selecting a destination the destination area for the paste operation

  1. Press Ctrl-V . The values will be pasted repetitively.

WinGrid Automatic Repetitive Paste in Grids 04.png

Figure 3: The source content as repetitively pasted into the destination selection

Limitations

While the automatic repetitive paste functionality works with an entire row of data selected through the Row Selector, selecting an entire column by the Column Header does not work, because, with it, the WinGrid does not recognize any of the cells as being selected. Therefore, any paste operations occurring in the latter case will result in cell values being pasted across the active row.