Back to Devexpress

DragRecordOverEventArgs.DropPositionRelativeCoefficient Property

wpf-devexpress-dot-xpf-dot-core-dot-dragrecordovereventargs.md

latest2.0 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

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

Property Value

TypeDescription
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:

xaml
<dxg:TreeListView AllowDragDrop="True" DragRecordOver="OnDragRecordOver" />
csharp
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

DragRecordOverEventArgs Class

DragRecordOverEventArgs Members

DevExpress.Xpf.Core Namespace