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

DropPosition Enum

Lists values that specify a record’s position after the drop operation.

Namespace: DevExpress.Xpf.Core

Assembly: DevExpress.Xpf.Core.v24.2.dll

NuGet Package: DevExpress.Wpf.Core

#Declaration

public enum DropPosition

#Members

Name Description
Append

A record is placed after all records.

Before

A record is placed before the target record.

After

A record is placed after the target record.

Inside

A record is placed inside the target group.

#Related API Members

The following properties accept/return DropPosition values:

#Remarks

Handle the DragRecordOver event and specify the DropPosition property to set the record’s position after the drop operation.

The following code sample demonstrates how to suppress the operation that moves the node to another child collection (the Inside drop position). The DropPositionRelativeCoefficient property contains a drop position offset relative to the target record:

<dxg:TreeListView AllowDragDrop="True" DragRecordOver="OnDragRecordOver" />
void OnDragRecordOver(object sender, DragRecordOverEventArgs e) {
   if(e.DropPosition == DropPosition.Inside) {
      e.DropPosition = e.DropPositionRelativeCoefficient > 0.5 ? DropPosition.After : DropPosition.Before;
      e.Handled = true;
   }
}

See Also