Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxCustomTileControl.OnItemDragOver Event

In This Article

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

#Declaration

Delphi
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.

Delphi
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