Drag Drop |
Post Reply |
Author | |
jcollier
Senior Member Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
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. |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
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 |
|
jcollier
Senior Member Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
|
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?
|
|
jcollier
Senior Member Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
|
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. |
|
jcollier
Senior Member Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
|
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.
|
|
jcollier
Senior Member Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
|
Any suggestions?
|
|
jcollier
Senior Member Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
|
Are there any other workarounds to this?
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Due to the first point a new event is added:
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |