Print Page | Close Window

Drag & drop with virtual records

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=24352
Printed Date: 29 March 2024 at 12:39am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Drag & drop with virtual records
Posted By: Fredrik
Subject: Drag & drop with virtual records
Date Posted: 24 January 2023 at 3:49am
Hi all, 

What's the trick handling drag & drop in a grid control having virtual records? I have added response handler for XTP_NM_GRID_BEGINDRAG but since I have virtual records I get the pointer to the same record regardless which one I drag. I could potentially use GetSelectedRows, but thought I should have the information needed in the XTP_NM_GRIDDRAGDROP structure.

Second question, is it possible to prevent the start of a drag operation when responding to XTP_NM_GRIDDRAGDROP ? I have tried setting different values on *pResult and pItemNotify->bReturnValue.

Third question: I tried to use XTP_NM_GRID_HASVALIDDROPTYPE message to change dropEffect, however, this is ignored in DROPEFFECT CXTPGridControl::OnDragOver? 

XTP_NM_GRIDDRAGDROP nmData;
nmData.dropEffect  = dropEffect;
nmData.pDataObject = pDataObject;
nmData.pt    = point;
// R-DD <<
nmData.dwKeyState = dwKeyState;
// R-DD >>

int iValid = (int)SendNotifyMessage(XTP_NM_GRID_HASVALIDDROPTYPE, (NMHDR*)&nmData);

m_nOLEDropAbove = nmData.bAbove;

if ((dropEffect != DROPEFFECT_NONE) // <- Shouldn't this be nmData.dropEffect?
&& (!pDataObject || (!pDataObject->IsDataAvailable(m_cfGrid) && iValid != 1)))
dropEffect = DROPEFFECT_NONE;


Regards, 
Fredrik

-------------
Windows 10, Visual Studio 20157, Toolkit Pro 18.3.0



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net