Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Drag and drop in grid Collapse All
Subject Author Date
Finn Arildsen Jul 23, 2006 - 4:22 PM

Could you point me to a tutorial on how to drag and drop a the contents of a grid cell to another grid cell?

Thanks in advance

Finn Arildsen

Technical Support Jul 24, 2006 - 5:10 AM

Drag-and-drop in the grid window is very specific to a particular project. The grid window supports only drag-and-drop for columns and rows, when a dragged item is highlighted with red arrow markers. You can implement drag-and-drop for data cells using the standard OLE drag-and-drop or code this drag-and-drop from scratch. In any case, it is possible to detect the selection region using the CExtGridWnd::Selection...() methods and serialize the region information and all the grid cells in this region including run-time type information about each cell object. This data can be de-serialized and inserted into the drop location. In this case the dropped cell region destroys existing cells and inserts new cell objects created from the archived data. It is also possible to perform custom operation with the dropped cells like partial replacement, arithmetical calculations for existing cells and dropped cells or string-based operations with them.

Finn Arildsen Jul 25, 2006 - 3:46 PM

Would I implement the OLE drag-and-drop in the OnGbwDataDndDo method?

Technical Support Jul 26, 2006 - 6:47 AM

Yes, you are right. The OnGbwDataDndDo() is designed exactly for this purpose.