<< Return to Main Index

< Return to Class Index

CGXGridCore::GetCopyTextRowCol

virtual CString GetCopyTextRowCol(ROWCOL nRow, ROWCOL nCol);

nRow

Specifies the row id.

nCol

Specifies the column id.

Return Value

Returns the text that should be copied to the text file.

Remarks

This virtual method is called from CopyTextToFile to get the text for a given cell. You might override this method if you want to copy formula expressions instead of the cell value.

Example:

CString CGXGridCore::GetCopyTextRowCol(ROWCOL nRow, ROWCOL nCol)
{
   // Override this method if you want to copy formula
   // expressions instead of text

   // Get text from control (and give control the chance
   // to convert value into unformatted text or vice versa).
   CString sText;
   CGXStyle* pStyle = CreateStyle();

   ComposeStyleRowCol(nRow, nCol, pStyle);

   CGXControl* pControl = GetRegisteredControl(pStyle->GetControl());
   if (pControl)
      pControl->GetControlText(sText, nRow, nCol, NULL, *pStyle);
   else
      sText = pStyle->GetValueRef();

   RecycleStyle(pStyle);

   return sText;
}

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

END Control-Factory Specific

See Also

CGXGridCore::CopyTextToFile

CGXGridCore

Class Overview | Class Members