dotnetmonitor.com |
|
||||||||||||
| When you enable cell
copying, you make the data in your DataGridView control easily accessible to
other applications through the Clipboard. The DataGridView control copies the
text representation of each selected cell to the Clipboard. This value is the
cell value converted to a string or, for image cells, the value of the
Description property. The content is then added to the Clipboard as
tab-delimited text values for pasting into applications like Notepad and Excel,
and as an HTML-formatted table for pasting into applications like Word.
You can configure cell copying to copy cell values only, to include row and column header text in the Clipboard data, or to include header text only when users select entire rows or columns.
The following table identifies the different clipboard copy modes:
Depending on the selection mode, users can select multiple disconnected groups of cells. When a user copies cells to the Clipboard, rows and columns with no selected cells are not copied. All other rows or columns become rows and columns in the table of data copied to the Clipboard. Unselected cells in these rows or columns are copied as blank placeholders to the Clipboard.
When users copy content, the DataGridView control adds a DataObject to the Clipboard. This data object is retrieved from the GetClipboardContent() method. You can call this method when you want to programmatically add the data object to the Clipboard. The GetClipboardContent() method retrieves values for individual cells by calling the DataGridViewCell.GetClipboardContent() method. You can override either or both of these methods in derived classes to customize the layout of copied cells or to support additional data formats. . |
||||||||||||
|
||||||||||||