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 » CExtGridBaseWnd, (vertical) drag drop Collapse All
Subject Author Date
a a Apr 10, 2006 - 2:14 AM

How do you retrieve the actual drop index?

I tried overriding OnGridOuterDragComplete, but it only gives you the hit test information of the mouse pointer (htInfoDrop.m_nRowNo).
It appears it is not necessary the row to be shifted, according to whether the mouse pointer is closer to the top or bottom of the row.

How do you determine that?
Is there no ready-to-use method to override with the actual indexes as parameter?

Code:
void DataGrid::OnGridOuterDragComplete(
const CExtGridHitTestInfo &htInfoDrag,
const CExtGridHitTestInfo &htInfoDrop)
{
CExtGridWnd::OnGridOuterDragComplete(htInfoDrag, htInfoDrop);

// updates external data, using source and destination index
}

Technical Support Apr 10, 2006 - 11:36 AM

The CExtGridCellHitTestInfo class contains information about where a cell/column/row is located. The htInfoDrop.m_nColNo and htInfoDrop.m_nRowNo values specify the exact cell location where the dragged cell is landed. Use the htInfoDrop.GetInnerOuterTypeOfColumn() and htInfoDrop.GetInnerOuterTypeOfRow() methods to detect where the outer header cell is drag-and-dropped. You can check whether htInfoDrop.m_dwAreaFlags flags contain __EGBWA_OUTER_DROP_AFTER to detect if the drop location is before or after the specified row/column.

a a Apr 10, 2006 - 7:08 PM

Thanks.
Solved by using __EGBWA_OUTER_DROP_AFTER.