CGXGridCore::EnableOleDropTarget
void EnableOleDropTarget(DWORD dwFlags = GX_DNDEGDESCROLL|GX_DNDAUTOSCROLL|GX_DNDTEXT|GX_DNDSTYLES);
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 method to make the grid an OLE Drop Target.
This method simplifies the registration of a grid as drop target compared to the steps necessary with Objective Grid version 6.0 or earlier.
Simply call
EnableOleDropTarget();
EnableOleDataSource();
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);
You can still continue to use the old approach with embedding a CGXGridDropTarget as member variable into your grid or parent dialog, This old approach will also be supported in future but we recommend that you use the newer approach when you write new grids.
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.
END Control-Factory Specific
See Also
CGXGridCore::EnableOleDataSource CGXGridDropTarget