Weblistbox drag and drop in 2025

OK, so now that Weblist boxes support drag and drop, how do we drag a row from lb1 to lb2?

Let’s assume both Weblistboxes have the same number of columns.

I assume as there is no dragrow, that we need to have a WebDragItem property. When the user selects the row of LB1 (the source) we need to set the row contense to the WebDragItem. Then when dropped onto LB2 (the target), we have a WebDragItem that triggers the DropObject event. where we add the row.

I’ve not gotten that to work yet.

Any suggestions?

On Desktop, in the lb1 start drag Event I copied the RowTags of the selected row to an array. In the lb2 drag released Event I added the rows to lb2 and removed them from lb1, based upon the array.

Here’s a pretty basic example I tossed together in a few minutes for moving data between two WebListboxes.

weblistbox_dragdrop.xojo_binary_project.zip (8.9 KB)

2 Likes

There is a related Feature Request:
#41852 - Enable WebListBox for Drag & Drop

I’m asking about web.

Thank you!

Not only did that work, but now I see how to extend/expand that for other needs. Thanks for showing me how that works.

The only issue is the UI looks like I’m dragging the whole listbox. But until xojo implements this, this may be the best we can do,

Again, thanks.