Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Drag Drop
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Drag Drop

 Post Reply Post Reply
Author
Message
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Topic: Drag Drop
    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.
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2007 at 1:56pm
Any suggestions?
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2007 at 10:03am
Are there any other workarounds to this?
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.