Skip to main content

TdxCustomTileControl.OnItemDragOver Event

Enables you to prohibit end-users from dropping tile items in certain groups.

Declaration

property OnItemDragOver: TdxTileControlItemDragOverEvent read; write;

Remarks

The Sender parameter references the tile control.

The AInfo parameter contains references to the tile item being dragged (AInfo.Item), the item’s initial group (AInfo.SourceGroup), and the group above which the mouse pointer is currently hovered (AInfo.Group). For a new group that will be automatically created as a result of a drag-and-drop operation, AInfo.Group returns nil. If one or more tile items are checked in the tile control, the drag-and-drop operation is applied to them. Refer to the OnItemDragBegin event description to learn more.

Pass False as the AAccept parameter to prohibit completing a drag-and-drop operation (dropping the items at the current mouse position). Otherwise, a drag-and-drop operation completes and the OnItemDragEnd event is fired.

Below are examples of handling the OnItemDragOver event and assigning the AAccept parameter in specific scenarios.

procedure TForm1.dxTileControl1ItemDragOver(Sender: TdxCustomTileControl; AInfo: TdxTileControlDragItemInfo; var AAccept: Boolean);
begin
  // An end-user can only rearrange tile items within their parent group,
  // item movements between groups are prohibited
  AAccept := AInfo.Group = AInfo.SourceGroup;
  // An end-user can freely re-arrange tile items, new groups cannot be created
  AAccept := AInfo.Group <> nil;
end;

Note

End-users can cancel a drag-and-drop operation in progress by pressing the Esc key. Handle the OnItemDragBegin event to prohibit end-user from moving certain tile items using drag and drop.

See Also