Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TMS Advanced Poly List
Drag & drop items

Drag & drop from one list to a second list can be done by implementing 2 events. Allowing an item to be dropped is setting the Accept parameter true. Dropping the item can be done by calling AddDropItem and as parameter the SelectedDragDropItem from the first list.
procedure TForm1.AdvPolyList2DragOver(Sender, Source: TObject; X, Y: 
Integer; State: TDragState; var Accept: Boolean);
begin
   Accept := Source is TAdvPolyList;
end;

procedure TForm1.AdvPolyList2DragDrop(Sender, Source: TObject; X, Y: Integer);
begin
   AdvPolyList2.AddDropItem((Source as TAdvPolyList).SelectedDragDropItem);
end;
Also internal drag drop is supported. This can be switched off by setting the Reorder parameter to false. When Reorder is true, a default red line will appear that will follow the mouse and show the insert position of the item you want to move.

This is also explained at page 34 of the PDF Developers Guide