CGXGridCore::EnableOleDataSource

BOOL EnableOleDataSource(DWORD dwFlags = GX_DNDTEXT | GX_DNDSTYLES | GX_DNDCOMPOSE | GX_DNDDIFFRANGEDLG);

dwFlags

You can specify and combine the following options:

  • GX_DNDCOLHEADER - include column header cells

  • GX_DNDROWHEADER - include row header cells

  • GX_DNDMULTI - allow dragging multiple selections

  • GX_DNDTEXT - supply data in CF_TEXT clipboard format

  • GX_DNDSTYLES - supply data in internal styles format

  • GX_DNDCOMPOSE - when copying internal styles, compose the full style of the cell and do not copy only the cell-specific attributes.

  • GX_DNDDIFFRANGEDLG - Display “Selected Range is Different” dialog when you Copy/Paste cells (has no effect for drag&drop. The flag will only be passed to m_nClipboardFlags).

Return Value

TRUE if OLE Drag&Drop functionality could be initialized; FALSE if initialization failed.

Remarks

Call this function to enable OLE Drag&Drop functionality in the grid for dragging cells to other OLE Drag&Drop-enabled applications.

Example:

void CMyGridView::OnInitialUpdate()
{
#if _MFC_VER >= 0x0400
   EnableOleDropTarget(GX_DNDEGDESCROLL | GX_DNDAUTOSCROLL | GX_DNDTEXT | GX_DNDSTYLES);
   EnableOleDataSource();
#endif
   CGXGridView::OnInitialUpdate();
}

Control-Factory Specific ->

Make sure that OLE Drag&Drop support has been linked into the grid library. See the section "Reducing the size of your application" in the user's guide how to remove or include Ole Drag&Drop support from the grid library using the Build Wizard.

END Control-Factory Specific

See Also

 CGXGridCore::DndStartDragDrop  CGXGridDropTarget  CGXGridCore::m_nClipboardFlags

CGXGridCore

 Class Overview |  Class Members