DropLocation always the same

I’m trying to implement dragging a listbox row into another listbox row. I thought that’s what the DropLocation is for.

I made a simple listbox with some values. Then I added another listbox to see the result of the code in DragOverRow:

Function DragOverRow(x As Integer, y As Integer, obj As DragItem, action As Integer, ByRef row As Integer, ByRef parentRow As Integer, ByRef location As DesktopListbox.DropLocations) Handles DragOverRow as Boolean
dim theLoc as Integer = integer(location)
ListBox2.AddRowAt(0, "x: " + Str(x) + " location: " + str(theloc) + " Row: " + Str(Row))
End Function

I slowly dragged a row down. The value for location, however, always stays the same. Bug or feature?

I’ve tried to run the example “Drag Between Cells.xojo_binary_project”. It doesn’t work either.

To me this looks like a bug in the DesktopListbox.

I’ve figured my problem out: I had DragReorder enabled (the new name “Allow Row Reordering” is so super silly). But I needed “Allow Row Dragging”. And then I get the correct location.

The example “Drag Between Cells.xojo_binary_project” is missing “Allow Row Dragging”, too. After enabling the drag works.

3 Likes

I also confuse these two properties sometimes. The new names don’t help.