Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The user can cut, copy, and paste data in the widget.
The following conditions apply when using cut, copy, or paste:

  • The active cell becomes the first cell of the target range when pasting.
  • The target range size may be adjusted to the source range size when copying and pasting.
  • Additional rows or columns may be added if the source range has more rows or columns than the target range and the target range is close to the edge (set the allowExtendPasteRange property to true for the Workbook options).
  • Multiple ranges can be copied and pasted to a single block of cells if they have the same number of rows or columns.
  • Filtered rows are not copied when copying a single range of cells or rows. Filtered rows are included when cutting data. The entire range is copied to the clipboard.

You can display an indicator after copying or cutting cell values. Use the options.cutCopyIndicatorVisible property to specify the indicator and the options.cutCopyIndicatorBorderColor property to specify the border color. The following image displays an indicator after selecting a block of cells and pressing the Ctrl + C keys.
Image Removed
用户可以在控件中剪切,复制和粘贴数据。

进行剪切板操作时,以下条件将会生效:

  1. 在粘贴时,当前活动单元格将会是当前选择区域的第一个单元格。
  2. 当前选中的单元格区域的大小将会自动调整到粘贴区域的大小。
  3. 当属性 allowExtendPasteRange 为true时,如果在工作表的边缘粘贴内容,当工作表的区域不够大时,将会自动添加行或者列。
  4. 你可以拷贝多个单元格区域,也可以粘贴多个单元格区域。但是多个单元格区域必须要有相同的行和列。
  5. 被筛选器过滤的行不会被复制,但是可以被剪切。


使用 options.cutCopyIndicatorVisible 属性来设置复制时的指示器是否可见,options.cutCopyIndicatorBorderColor 用来设置指示器边框的样式。

如下图所示,选中一个区域并按下 Ctrl + C,将会显示一个虚线的边框,虚线边框即为复制指示器。

Image Added

你可以使用 options.copyPasteHeaderOptions 属性来设置是否复制或粘贴列表头区域。
You can specify whether to copy and paste headers with Workbook options.copyPasteHeaderOptions.

Image Removed

Image Added

The

options.clipBoardOptions

property only applies to copying and pasting data.

...

属性只在复制和粘贴的时候起作用。.

在复制和粘贴时,也会将样式信息一并带入。更多信息请参考:Copying and Pasting Styles. Using Code
This example specifies the paste options.


示例代码
以下代码使用了粘贴选项。

JavaScript

Copy Code

activeSheet.options.clipBoardOptions = GC.Spread.Sheets.ClipboardPasteOptions.Values;

 

See Also另见
Workbook Method
copyTo Method
ClipboardPasteOptions Enumeration
options Field
CopyPasteHeaderOptions Enumeration