Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

用户可以在控件中剪切,复制和粘贴数据。

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

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


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

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

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

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

在复制和粘贴时,也会将样式信息一并带入。更多信息请参考:Copying and Pasting Styles


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

JavaScript

Copy Code

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

 

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

  • No labels