DropObj behaving differently Mac/Windows

I am using two DesktopListboxes, and dragging multiple rows from one to the other. The DragRow code looks like this:

For i = 0 To Me.LastRowIndex
If Me.RowSelectedAt(i) Then
drag.AddItem(0, 0, 0, 0)
drag.text = Me.CellTextAt(i, 0) + “,” + Me.CellTextAt(i, 1) + “,” + Me.CellTextAt(i, 2) + “,” _
+ Me.CellTextAt(i, 3) + “,” + Me.CellTextAt(i, 4)
End If
Next

The DropObj code looks like this:

Do
i = Me.RowCount
t = obj.text.ToText.Split(“,”)
Me.AddRowAt(i, t(0)) // remove the last row which should be blank
Me.CellTextAt(i, 1) = t(1)
Me.CellTextAt(i, 2) = t(2)
Me.CellTagAt(i, 3) = Double.Parse(t(3))
Me.CellTextAt(i, 4) = t(4)
Me.CellTagAt(i, 4) = Double.Parse(t(4))
Me.CellTextAt(i, 3) = Format(handiCap, “0.000”)
Loop Until Not obj.NextItem

It works fine on Mac. On Windows, there is an Out of Bounds exception, due to the text t being nil, or having an index of -1. The DropObj has no text in Windows, but does in Mac. Stepping through both versions, when adding text to the DragItem they look the same, text is added. When it gets to the drop it seems to have disappeared. If I do a single DragItem like this:

drag.text = Me.CellTextAt(row, 0) + “,” + Me.CellTextAt(row, 1) + “,” + Me.CellTextAt(row, 2) + “,” _

  • Me.CellTextAt(row, 3) + “,” + Me.CellTextAt(row, 4)
    Return True

Then it works on Windows. But doesn’t drop multiple rows.

Is this a bug? Or something wrong with my code?

I don’t know about the difference between Mac and Windows, here, but you have a workaround: use a single drag item where end of lines are each row.

Your data, in a single drag item, would look like (assuming rows 0, 5 and 7 are selected):
Row0Column0,Row0Column1,Row0Column2,Row0Column3,Row0Column4
Row5Column0,Row5Column1,Row5Column2,Row5Column3,Row5Column4
Row7Column0,Row7Column1,Row7Column2,Row7Column3,Row7Column4

Unfortunately there are other items in the rows being dragged (cell tags) which I also need and would not come with a single drag item. I removed them from the example because they don’t seem to cause the problem.

Seems to be a bug, I will start an issue on it.

1 Like