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?