"Drag n' Drop" between 2 DScrollPanels?


Basically I want to be able to drag and drop DLabels between two DScrollPanels. Imagine dragging grocery list items between two lists.

I’m aware of PANEL:Droppable() and PANEL:Receiver()
But they don’t seem to work well with things inside DScrollPanel

(Also should be draggable within one list to rearrange list items)

I assume you have already seen this guide: Drag and Drop for VGUI - Garry's Mod Wiki
You can also ask on the Discord, maybe someone will have a solution to your problem.

Stumbled across an example of what I was trying to do:

Specifically, this code that was provided

local function DoDrop( self, panels, bDoDrop, Command, x, y )
	if ( bDoDrop ) then
		for k, v in pairs( panels ) do
			self:AddItem( v )

concommand.Add( "test2", function()

	local frame = vgui.Create( "DFrame" )
	frame:SetSize( 500, 300 )
	frame:SetTitle( "Frame" )

	local left = vgui.Create( "DScrollPanel", frame )
	left:Dock( LEFT )
	left:SetWidth( frame:GetWide() / 2 - 7 )
	left:SetPaintBackground( true )
	left:DockMargin( 0, 0, 4, 0 )
	left:Receiver( "myDNDname", DoDrop ) -- Make the panel a receiver for drag and drop events

	local right = vgui.Create( "DScrollPanel", frame )
	right:Dock( FILL )
	right:SetPaintBackground( true )
	right:Receiver( "myDNDname", DoDrop )

	for i = 1, 30 do
		local but = vgui.Create( "DButton" )
		but:SetText( i )
		but:SetSize( 36, 24 )
		but:Dock( TOP )
		but:Droppable( "myDNDname" ) -- make the panel be able to be drag'n'dropped onto other panels
		right:AddItem( but )

end )

Thank you!