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.v20.1.dll

Declaration

public double DropPositionRelativeCoefficient { get; }
Public ReadOnly Property DropPositionRelativeCoefficient As Double

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