BaseView.CopyToClipboard() Method
Copies the selected record(s) to the Clipboard as text.
Namespace: DevExpress.XtraGrid.Views.Base
Assembly: DevExpress.XtraGrid.v24.2.dll
NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation
#Declaration
#Remarks
The CopyToClipboard method copies the selected records to the Clipboard as text. Only the contents of the visible columns are copied. For group rows, this method copies only the values of the grouping columns. Records hidden under the collapsed group rows are not included.
If the OptionsClipboard.CopyColumnHeaders option is enabled, the CopyToClipboard method also copies the column captions to the Clipboard.
Records in the Clipboard are separated by the newline strings (“\r\n”). The TAB character (“\t”) is used to separate the values within a record.
The currently selected record(s) can be accessed via the ColumnView.GetSelectedRows method.
The CopyToClipboard method is automatically called when the CTRL+C shortcut is pressed while a View is focused.
If the GridOptionsSelection.MultiSelectMode property equals CellSelect, the CopyToClipboard method copies data only from selected cells.
Note
Copying a large amount of data to the Clipboard can cause an exception if there are limited memory resources. To limit the number or rows when copying to the Clipboard, use the Base
Note
Detail pattern Views do not contain data and they are never displayed within Xtra
- Grid
Control. - returns the top most View in a grid;Main View - Grid
Control. - returns the focused View;Focused View - Grid
Control. - returns the currently maximized View;Default View - the sender parameter of View specific events;
- Grid
View. - returns a detail clone View for a specific master row.Get Detail View
#Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CopyToClipboard() method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.