<< Return to Main Index

< Return to Class Index

CGXGridCore::Paste

virtual BOOL Paste( );

Return Value

TRUE when pasting was successful; it is FALSE if the operation failed or if the user aborted pasting.

Remarks

Pastes data from the clipboard.

Paste will first give the current cell’s control a chance to paste data. If the current cell is for example an RTF control and the clipboard data is available in RTF format, the current cell will paste the data. See CGXControl::CanPaste and CGXControl::Paste.

If CGXControl::Paste did return FALSE, Paste will call the overridable method OnPasteFromClipboard after the clipboard has been opened. If you would like to add support for pasting additional clipboard formats, you should override OnPasteFromClipboard.

The base-class version of OnPasteFromClipboard will check for the internal clipboard format and if the the internal format is not available, it will check for the CF_TEXT format.

Note:

There is some special behavior for CGXBrowserGrid (also DAO, ODBC and ADO grid):

The default implementation of the Paste() method in CGXBrowserGrid only supports pasting into one cell. If you want the user to be able to paste multiple lines of text into the grid initialize GetBrowseParam()->m_bAllowPasteMultiCells = TRUE and m_nClipboardFlags = GX_DNDTEXT.

Control-Factory Specific ->

This method has been implemented using the abstraction mechanism as discussed in the chapter "Reducing the size of your application" in the user's guide. A call to the ImplementCutPaste method from within the control factory class' InitializeGridComponents method will make the concrete implementation of this method available to your application.

If no concrete implementation is available this method returns FALSE. No action is performed.

END Control-Factory Specific

See Also

CGXGridCore::CanPaste CGXGridCore::OnPasteFromClipboard CGXControl::CanPaste CGXControl::Paste

CGXGridCore

Class Overview | Class Members