CGXGridDropTarget::Register

BOOL Register(CGXGridCore* pGrid, DWORD dwFlags = GX_DNDEGDESCROLL | GX_DNDAUTOSCROLL | GX_DNDTEXT | GX_DNDSTYLES);

pGrid

A pointer to the grid object.

dwFlags

Specifies the drop target behavior. dwFlags can be a combination of any of the following flags:

GX_DNDEGDESCROLL - enable autoscrolling when user drags the mouse near the edge inside of the drop target window.

  • GX_DNDAUTOSCROLL - enable autoscrolling when user drags mouse out of window (and the grid is also the data source).

  • GX_DNDTEXT - accept CF_TEXT clipboard format.

  • GX_DNDSTYLES - accept internal styles format.

  • GX_DNDDIFFRANGEDLG - (Copy/Paste only): Display “Selected Range is Different”dialog when you Copy/Paste cells.

  • GX_DNDNOAPPENDROWS - if the user drags the cell rectangle to the bottom of the grid and pastes (drops) more rows than currently left in the grid, don’t append new rows.

  • GX_DNDNOAPPENDCOLS - if the user drags the cell rectangle to the right of the grid and pastes (drops) more columns than currently left in the grid, don’t append new columns.

  • GX_DNDEXPRESSION - Copy Expression instead of value (when GX_DNDSTYLES is set). This setting has no effect for direct copy/paste in sheet and for CF_TEXT clipboard format.


  • RemarksCall this function to register your window with the OLE DLLs as a valid drop target. This function must be called for drop operations to be accepted.

This function will also assign dwFlags to the CGXGridCore::m_nClipboardFlags attribute to make sure that Copy/Paste behavior is consistent with Drag and Drop.

See the class description for an example.

Note:

Objective Grid 6.1 introduced a new method that simplifies the registration of a grid as drop target compared to the steps necessary with Objective Grid version 6.0 or earlier. There is no need for you to learn details about the CGXGridDropTarget class any more.

Simply call

   EnableOleDropTarget();

at grid initialization time.

If you want to customize the OLE Dnd behavior you can pass a combination of flags as parameter.

Example:

   EnableOleDropTarget(GX_DNDEGDESCROLL | GX_DNDAUTOSCROLL | GX_DNDTEXT | GX_DNDSTYLES);

See Also

 CGXGridCore::EnableOleDataSource  CGXGridCore::m_nClipboardFlags  CGXGridCore::EnableOleDropTarget

CGXGridDropTarget

 Class Overview |  Class Members