Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

QuantumGrid - Drag and drop

139 views
Skip to first unread message

Johanna Leimer

unread,
Aug 31, 2004, 12:30:45 PM8/31/04
to
Does anyone know how to find out where exactly at the target the user
dropped the dragged item?

Suppose I have a ListView with a couple of rows in it as the target. Now I
would like to find out on which row in the list view the user dropped the
dragged item so that I can react accordingly.

Any help is very much appreciated.


Alex Taylor

unread,
Sep 1, 2004, 6:40:24 AM9/1/04
to
Many VCL component has the OnDragDrop event-handler that passes the
actual mouse X and Y coordinates relative to the target control. Almost
every item based control has some methods to find out the item from XY
coordinates. TListView has the GetItemAt,GetNearestItem methods that do
exactly what you want.

Regards:Alex

Developer Express - Richard Morris

unread,
Sep 1, 2004, 1:21:51 PM9/1/04
to
"Johanna Leimer" <johl...@yahoo.de> wrote

> Does anyone know how to find out where exactly at the target the user
> dropped the dragged item?

Send an email to sup...@devexpress.com (Developer Express support channel)
and we'll be glad to show you.

rgds,
Richard Morris


Johanna Leimer

unread,
Sep 1, 2004, 2:16:45 PM9/1/04
to
@Alex

Thanks, that helped me a bit further although I couldn't solve my problem.
It works for a ListView but when I use a TcxGrid there ist no GetItemAt
method.

In the view of the cxGrid I can call GetHitTest(X,Y).HitTestCode to find out
whereabouts the drop was (e.g. htCell oder htHeader). But how do I find out
which cell (even row would be enough for me) the drop took place?

The SelectedRow or FocusedRow don't change during a Drag-and-Drop although
the rows where the mouse is over get highlighted. There must be a way to
find out. Any more ideas?


0 new messages