/
MainWindow.xaml.vb
28 lines (23 loc) · 1020 Bytes
/
MainWindow.xaml.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Imports DevExpress.Xpf.Core
Imports System.Windows
Namespace WPF_GridControl_Custom_Drag_and_Drop
Public Partial Class MainWindow
Inherits Window
Public Sub New()
Me.InitializeComponent()
Me.gridControl.ItemsSource = GetStaff()
End Sub
Private Sub OnDropRecord(ByVal sender As Object, ByVal e As DropRecordEventArgs)
Dim data As Object = e.Data.GetData(GetType(RecordDragDropData))
For Each employee As Employee In CType(data, RecordDragDropData).Records
employee.Position = CType(e.TargetRecord, Employee).Position
employee.Department = CType(e.TargetRecord, Employee).Department
Next
If e.DropPosition = DropPosition.Inside Then
For Each employee As Employee In CType(data, RecordDragDropData).Records
employee.Position = ""
Next
End If
End Sub
End Class
End Namespace