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

DiagramControl.QueryItemSnapping Event

Fires repeatedly as the end-user triggers snapping while dragging or resizing a diagram shape.

Namespace: DevExpress.XtraDiagram

Assembly: DevExpress.XtraDiagram.v24.2.dll

NuGet Package: DevExpress.Win.Diagram

#Declaration

[DiagramCategory(DiagramCategory.DiagramItems)]
public event EventHandler<DiagramQueryItemSnappingEventArgs> QueryItemSnapping

#Event Data

The QueryItemSnapping event's data class is DiagramQueryItemSnappingEventArgs. The following properties provide information specific to this event:

Property Description
Allow Specifies whether to snap of diagram items.
Item Returns the item that is being dragged by the end-user.
SnapTo Returns the diagram item to which the item being dragged by the end-user can be snapped.

#Remarks

The SnapTo event’s parameter returns the item suitable for snapping (nearest in height/width when the end-user resizes an item or one lying on the same line when the end-user drags an item). The item that is being moved or resized is returned by the Item parameter. The Allow parameter specifies whether to enable snapping to the suitable item.

See Also