Skip to main content

NavBarControl.NavDragOver Event

Fires repeatedly when a link is being dragged and is allowed to be dropped.

Namespace: DevExpress.XtraNavBar

Assembly: DevExpress.XtraNavBar.v23.2.dll

NuGet Packages: DevExpress.Win, DevExpress.Win.Navigation

Declaration

public event NavBarDragDropEventHandler NavDragOver

Event Data

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

Property Description
AllowedEffect Gets which drag-and-drop operations are allowed by the originator (or source) of the drag event. Inherited from DragEventArgs.
Data Gets the IDataObject that contains the data associated with this event. Inherited from DragEventArgs.
Effect Gets or sets the target drop effect in a drag-and-drop operation. Inherited from DragEventArgs.
Group Gets a group into which a dragged item is about to be or has been dropped.
InsertPosition Gets the position within the group to which the link is about to be or has been dropped.
KeyState Gets the current state of the SHIFT, CTRL, and ALT keys, as well as the state of the mouse buttons. Inherited from DragEventArgs.
X Gets the x-coordinate of the mouse pointer, in screen coordinates. Inherited from DragEventArgs.
Y Gets the y-coordinate of the mouse pointer, in screen coordinates. Inherited from DragEventArgs.

Remarks

The NavBarControl allows end-users to perform link drag and drop operations. Write a NavDragOver event handler to perform repeated actions when a link is being dragged and it is allowed to be dropped.

Use the NavBarControl.DragDropFlags and NavBarGroup.DragDropFlags properties to control the component’s behavior in relation to link drag and drop operations.

Example

The sample code below represents a NavBarControl.NavDragOver event handler. The event handler prohibits dropping to all but the last item in the group. The target group is identified via the NavBarDragDropEventArgs.Group property of the event’s parameter. The dropping position is obtained via the NavBarDragDropEventArgs.InsertPosition property.

using DevExpress.XtraNavBar;
using DevExpress.XtraNavBar.ViewInfo;

private void navBarControl1_NavDragOver(object sender, NavBarDragDropEventArgs e) {
   NavBarGroup targetGroup  = e.Group;
   if (e.InsertPosition != targetGroup.VisibleItemLinks.Count) {
      e.Effect = DragDropEffects.None;
   }
}
See Also