Welcome! Log In Create A New Profile

Advanced

Detect Drag&Drop

Posted by Piet van Zanten 
Piet van Zanten
Detect Drag&Drop
October 02, 2008 05:01PM
Hi All,

I have a memorytable with automatic DnD enabled. The table is source and target so users can drag rows of the table to a different row. If the row order of the table has been changed, it's contents should be saved. How can I detect that the row order has changed by means of drag and drop?

Best regards,
Piet
Alexandre Leclerc
Re: Detect Drag&Drop
October 02, 2008 06:06PM
Hi Piet,

(This is french):

TableInfoXY(_DND.ChampCible,tiNumLigne,_DND.SourisPosX,_DND.SourisPosY)

Use this code in the procedure managing the drop event. This will give you the line where the drop occurs. Then compare the actually selected row number with that new number.

Best regards.
Piet van Zanten
Re: Detect Drag&Drop
October 04, 2008 12:02AM
Hi Alexandre,

Thanks for your reply, but I want to avoid programmed DnD. Just want to set a flag if a change of order occurred and save the whole table.

Regards,
Piet
Piet van Zanten
Detect Drag&Drop using Event
October 04, 2008 12:03AM
Hi,

Does anyone know if it's possible to detect drag or drop using Event?

Regards,
Piet



Edited 1 time(s). Last edit at 10/04/2008 12:04AM by Piet van Zanten.
Fabrice Harari
Re: Detect Drag&Drop using Event
October 04, 2008 05:14PM
Hi Piet...

considering that everything in windows works via events, I would say yes...

To find out what event to trap, just set an event on ALL (see event help for syntax) on the table handle... In this event procedure, trace the event number and wparam, lparam...

Then do a drag and drop and read directly the vent number you need and perhaps even some interesting informations in wparam, lparam (line number?)

Best regards

Fabrice Harari
WinDev, WebDev, WinDev Mobile consulting
Piet van Zanten
Re: Detect Drag&Drop using Event
October 04, 2008 07:35PM
Thanks, Fabrice.

I already solved it. It appears that automatic and programmed DnD can be active simultaneously. So I did a DnDEvent("Drop_SetFlag",TABLE_PlayList,dndDrop).
That works while automatic Dnd still works too.

Regards,
Piet
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: