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

DragRecordOverEventArgs.DropPositionRelativeCoefficient Property

Gets a number between 0 and 1, presenting a drop position relative to the target record.

Namespace: DevExpress.Xpf.Core

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

NuGet Package: DevExpress.Wpf.Core

#Declaration

public double DropPositionRelativeCoefficient { get; }

#Property Value

Type Description
Double

A number that presents a drop position relative to the target record.

#Remarks

The following code sample demonstrates how to prohibit end-users from moving nodes to another node’s child collection:

<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;
   }
}

In this code sample, the DropPositionRelativeCoefficient property is used to determine the exact drop position.

The DropPosition enumeration lists possible drop position values.

See Also