Print Page | Close Window

Drag and Drop questions.

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=7484
Printed Date: 13 November 2024 at 11:21pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Drag and Drop questions.
Posted By: rthoreson
Subject: Drag and Drop questions.
Date Posted: 28 June 2007 at 9:27pm

Hello everyone.

I am currectly working on a C# application and I have a few questions about drag and drop for the report control.
 
1.  Is it possible to stop the control from executing an event?  For instance, I hook the dropRecords event, do some processing to add the item to the report control manually.  Unfortunately, when my code exits, the control itself continues to process the event and adds the items again.  Is there a way to stop the control from adding the items or is there another way I should be handling this?
 
2.  MouseMove events while dragging, none are generated.  Is there a way to get mousemove events while dragging?
 
3. Support for other 'drag and drop' events?  What about support for events such as 'DragOver', 'DragEnter', 'DragLeave', 'GiveFeedBack' and 'QueryContinueDrag'?
 
Thanks.



Replies:
Posted By: sserge
Date Posted: 05 July 2007 at 3:45pm
Hi,

Firstly some notes about Drag&Drop in report control.
This part was changed in latest versions and I will tell about version 11.1.3.
 
Report Control support 2 layers of Drag&Drop:
-- Internal Drag&Drop;
-- OleDrop (or External Drop)

Internal Drag&Drop is enabled using EnableDragDrop() method and allow you to copy or move records.
 
OleDrop mode works only when Internal Drag&Drop enabled and OLEDropMode property is set to ccOLEDropManual.
 
When you drop records the event DropRecordsEx (and DropRecords) is fired before records collection is changed. In this event you can modify recors, add/remove records in provided collection. If you perform custom drop - remove all elements from Records collection to skip default processing.

When records dropped and control is populated - RecordsDropped event is fired.

If OleDrop mode enabled the additional events are fired:
 -) OLEDragOver;
 -) OLEDragDrop is fired when you drop some other data format than specified in EnableDragDrop call or when xtpReportAllowDrop flag is not set and you drop 'this control' records.
 
'this control' records has data format specified in EnableDragDrop.
 
When you drop 'this control' records and xtpReportAllowDrop is set -- the DropRecordsEx (and DropRecords) fired instead of OLEDragDrop.
 
This allow you to process 'this control' records drop and External data drop separately

So, answering your questions:
>> 1.  Is it possible to stop the control from executing an event?  For instance, I hook the dropRecords event, do some processing to add the item to the report control manually.  Unfortunately, when my code exits, the control itself continues to process the event and adds the items again.  Is there a way to stop the control from adding the items or is there another way I should be handling this?   
   
When you perform custom drop - remove all elements from Records collection to skip default processing.
 
>> 2.  MouseMove events while dragging, none are generated.  Is there a way to get mousemove events while dragging?

No way, but OLEDragOver is fired when OleDrop mode enabled.
 
>> 3. Support for other 'drag and drop' events?  What about support for events such as 'DragOver', 'DragEnter', 'DragLeave', 'GiveFeedBack' and 'QueryContinueDrag'?

See the description above. The existing mechanism allows you to perform all (or the most of all) operations.

--
WBR,
Serge 


Posted By: rthoreson
Date Posted: 11 July 2007 at 4:46pm
Thanks!
 
Turns out, the OLE events are exaclty what I was looking for.
 


Posted By: mlatona
Date Posted: 12 July 2007 at 6:05am
Hi,
 
the parameter 'Source' is missing in the events 'OLEDragOver' and 'OLEDragDrop'. Why????
 
 



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