Objective Grid: Pasting text without changing format

Article ID: 435
Last updated: 27 Apr, 2018
Article ID: 435
Last updated: 27 Apr, 2018
Revision: 3
Views: 1718
Posted: 09 Jan, 2001
by Meltreger B.
Updated: 27 Apr, 2018
by Meltreger B.

Problem

 


During a copy/paste operation, how can I avoid changing the format of the destination cells? I only want to copy the text values.

 

 


Cause

 


 

 


Action

 


You can specify GX_DNDTEXT when you call EnableOleDataSource() and also when you register the grid as drop target.

Example:

int CMyGridView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CGXGridView::OnCreate(lpCreateStruct) == -1)
return -1;
#if _MFC_VER >= 0x0400
// Enable grid to be used as data source
EnableOleDataSource(GX_DNDTEXT);

// Register the grid as drop target
VERIFY(m_objDndDropTarget.Register(this, GX_DNDEGDESCROLL | GX_DNDAUTOSCROLL | GX_DNDTEXT));

...

}

- Or - (for clipboard setting only)

m_nClipboardFlags = GX_DNDTEXT;

This article was:   Helpful | Not helpful
Report an issue
Article ID: 435
Last updated: 27 Apr, 2018
Revision: 3
Views: 1718
Posted: 09 Jan, 2001 by Meltreger B.
Updated: 27 Apr, 2018 by Meltreger B.

Others in this category