Print Page | Close Window

Drag Drop

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=6419
Printed Date: 19 September 2024 at 8:49pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Drag Drop
Posted By: jcollier
Subject: Drag Drop
Date Posted: 14 February 2007 at 12:41pm
I've got Drag and Drop on a report control working almost like I need.  I'm using 10.4.2 and one report control.

Here's what's happening.

A user drags records from one row on the report to another row.  After they drop them, I need to loop the rows in the entire control in their new order.  However, in the DropRecords event, when I loop through, the records, they are still in the original order.  Any way to accomplish this?

I also tried a flag with the mouseup event but it wasn't even firing when the user was dropping records.



Replies:
Posted By: sserge
Date Posted: 15 February 2007 at 4:32pm
Yes, records collection is updated when you return from DropRecords handler.
 
But you can use a timer to liberate this behavior.
 
Add a timer with small timeout (10-100 milliseconds) which is disabled by default. In DropRecords handler just enable this timer (and, if necessary, remember dror context). In OnTimer event handler disable timer and make your iteration. Records order will be new.  OnTimer comes after all drop steps processed.

This should help.

--
WBR,
Serge


Posted By: jcollier
Date Posted: 16 February 2007 at 9:20am
That will probably work as a workaround.  What do I need to do to put an enhancement request in to add an event that occurs after DropRecords so that I can avoid the timer in the future?


Posted By: jcollier
Date Posted: 20 March 2007 at 4:27pm
I've just noticed that the DropRecords event doesn't fire if OLEDropMode = 1.  Is there any way to make both fire off?

The reason I want to do this is to use drop records to allow the user to reorder the records.  However, I am showing them a messagebox allowing them to cancel it before the reorder.  If I use OLEDragDrop and they cancel, the reorder still occurs.

I want the OLEDragDrop also so that users can drag files from Explorer onto the grid and I capture the paths. 

I guess another solution that would help me is just being able to cancel the reorder from OLEDragDrop.


Posted By: jcollier
Date Posted: 20 March 2007 at 4:29pm
Actually, let me add to it.  I don't seem to be able to cancel it from DragRecords either.  I'm sure I'm missing something.


Posted By: jcollier
Date Posted: 22 March 2007 at 1:56pm
Any suggestions?


Posted By: jcollier
Date Posted: 03 April 2007 at 10:03am
Are there any other workarounds to this?


Posted By: sserge
Date Posted: 12 April 2007 at 2:47pm
Due to the first point a new event is added:

    RecordsDropped(IReportRecord* TargetRecord, IReportRecords* Records, VARIANT_BOOL Above);


Will be available in 11.1.0
 
For OLEDrop mode you have to process all dragging manually.
check is drop data files - process as for files. Otherwise use CreateRecordsFromDropArray and move or copy thise record manually.
I think this is not too hard.
 
see our VB sample, frmDragDrop for example.
 

Of course, this looks as a workaround. We will fix this in report,  that for report data format DragDrop will be fired, and OLEDragDrop for other formats.
 
This will not be available in 11.1.0, but in later version only. If you need an update, post a request into support area.

--
WBR,
Serge



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