<< Return to Main Index

< Return to Class Index

CGXGridCore::CopyRange

virtual BOOL CopyRange(const CGXRangeList& selList);

BOOL CopyRange(const CGXRange& range);

selList

A reference to range list.

range

A reference to a single range object.

Remarks

Copies the specifed range of cells to the clipboard. The method differs from Copy in that you need not select ranges with SelectRange before calling this method.

CopyRange will copy the cells both in internal format and CF_TEXT format to the clipboard. The CF_TEXT format is done with CopyTextToFile. The internal format is done with CopyCellsToArchive.

CopyTextToFile determines the text which is copied to the clipboard by calling the CGXControl::GetControlText method for each cell. This makes sure that the text is written exactly as it is displayed in the cell (even if the style value is different from the displayed text for the cell, as for example in masked edit, RTF or combo boxes).

You might override CopyRange to add support for additional clipboard formats.

The second prototype of this method is simply a wrapper for calling CopyRange with a single range instead of a range list.

If you want to have a different column delimiter than the default tab ‘\t’, you might change the internal m_sExportTabDelim attribute in the CGXGridCore class.

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. A warning will be displayed in the debug window.

END Control-Factory Specific

See Also

CGXGridCore::CopyTextToFile CGXGridCore::CopyCellsToArchive CGXControl::GetControlText

CGXGridCore

Class Overview | Class Members