Skip to main content

TcxCustomGridTableView.CopyToClipboard(Boolean) Method

Copies the View content to the clipboard as text.

Declaration

procedure CopyToClipboard(ACopyAll: Boolean);

Parameters

Name Type
ACopyAll Boolean

Remarks

The View content to be copied to the clipboard includes:

  • Visible item (column or row) captions. You can optionally exclude them from the resulting text via the View’s OptionsBehavior.CopyCaptionsToClipboard property. In the resulting text, item captions are positioned on the first line and are separated from each other by the Tab character;

  • Cell values of visible items in potentially visible rows, i.e., those rows that can be made visible by scrolling. For group rows, the method copies only their group column values. Any data hidden under collapsed group rows is not copied. In the resulting text, each row occupies one line. Cell values within a line are separated from each other by the Tab character. Item captions (if included) are separated from rows by the line break (#13#10);

  • Preview sections. You can optionally exclude them from the resulting text via the View’s OptionsBehavior.CopyPreviewToClipboard property. In the resulting text, each preview cell value is appended to the last cell value in the corresponding row line after the Tab character.

With the ACopyAll method parameter, you can switch the scope of the copy operation. Pass False as this parameter to allow the method to copy only the selected View elements (records or cells). Otherwise, the entire View content will be copied.

End-users can copy the View content to the clipboard using the Ctrl+C or Ctrl+Ins key combination provided that the View’s OptionsBehavior.CopyRecordsToClipboard property is set to True.

If you need to copy the contents of a detail View, call the CopyToClipboard method of a specific detail View clone, rather than that of a pattern View. The following example demonstrates how to copy the contents of the tvProducts detail Table View.

//...
if tvProducts.CloneCount > 0 then
  TcxCustomGridTableView(tvProducts.Clones[0]).CopyToClipboard(True);
See Also