I try to drag items from a listview to a Treeview.

I use the following code but I don't know how to do the folowing points :

1 - Check if data dragged onto the treeview is listview item collection

2 - When dragdrop, retrieving data from the listview item collection dropped

Thanks in advance ;-)

here is my code :

VB Code:
  1. Private Sub ListView1_ItemDrag(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemDragEventArgs) Handles ListView1.ItemDrag
  2.         ListView1.DoDragDrop(ListView1.SelectedItems, DragDropEffects.Copy Or DragDropEffects.Move)
  3.  
  4.     End Sub
  5.  
  6.  
  7.     Private Sub TreeView1_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles TreeView1.DragOver
  8.         Dim Pt As Point
  9.         Dim Node As TreeNode
  10.  
  11.         'If Not (TypeOf sender Is ListView.SelectedListViewItemCollection) Then Exit Sub
  12.         'If e.Data.GetDataPresent(GetType(System.Windows.Forms.ListView.ListViewItemCollection)) = True Then
  13.         Pt = TreeView1.PointToClient(New Point(e.X, e.Y))
  14.         Node = TreeView1.GetNodeAt(Pt)
  15.         If Microsoft.VisualBasic.Left(Node.Tag, 7) = "AGENT  " Then
  16.             e.Effect = DragDropEffects.Move
  17.         Else
  18.             e.Effect = DragDropEffects.None
  19.         End If
  20.         'End If
  21.     End Sub
  22.  
  23.     Private Sub TreeView1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles TreeView1.DragDrop
  24.         Dim Result As DialogResult
  25.         'popup confirmation du move
  26.         Result = MsgBox("Etes vous sure de vouloir transférer les dossier ?", MsgBoxStyle.YesNo, "Transfer dossier")
  27.         If Result = DialogResult.No Then Exit Sub
  28.         'update agent traitant des dossiers concerné par le nouvel agent
  29.         Dim Items As ListView.ListViewItemCollection()
  30.         Items = CType(e.Data.GetData(GetType(System.Windows.Forms.ListView.ListViewItemCollection)), ListView.ListViewItemCollection())
  31.         'refresh treeview
  32.     End Sub