title: Determine if DataGridView Row being Dragged over Treeview
body: <p>How would I determine if the item I'm dragging from a DataGridView to a TreeView is actually a DataGridView Row?</p>
  
  <p>I have TreeView that already has the ability to drag and drop into itself, however I want to put a check in the TreeView DragOver to check to see if its a TreeNode or a DataGridView Row.</p>
  
  <p>I know I can check if its a TreeView Node by doing..</p>
  
  <pre><code>If e.Data.GetDataPresent("System.Windows.Forms.TreeNode", True) = False Then Exit Sub
  </code></pre>
  
  <p>But I tried doing..</p>
  
  <pre><code>If e.Data.GetDataPresent("System.Windows.Forms.DataGridViewRow", True) = False Then Exit Sub
  </code></pre>
  
  <p>But this isn't working for me.  I'm not sure what I'm doing wrong?</p>
  
  <pre><code>Private Sub dataGridView1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles DataGridView1.MouseDown
          If DataGridView1.CurrentRow Is Nothing Then Exit Sub
  
          If e.Button = MouseButtons.Left And DataGridView1.CurrentCell.ColumnIndex &gt;= 0 Then
  
              dragedItemText = DataGridView1.Rows(DataGridView1.CurrentCell.RowIndex).Cells(0).Value.ToString
              dragedItemEXT = DataGridView1.Rows(DataGridView1.CurrentCell.RowIndex).Cells(1).Value.ToString
              dragedItemRowIndex = DataGridView1.CurrentCell.RowIndex
  
              DataGridView1.DoDragDrop(dragedItemText, DragDropEffects.Copy)
  End Sub
  
  
  Public Sub TreeView1_DragEnter(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs)
          e.Effect = DragDropEffects.Copy
          If e.Data.GetDataPresent("System.Windows.Forms.DataGridViewRow", True) Then
              Console.WriteLine("DataGridViewRow")
              e.Effect = DragDropEffects.Move
              Exit Sub
          End If
          'See if there is a TreeNode being dragged
          If e.Data.GetDataPresent("System.Windows.Forms.TreeNode", True) Then
              'TreeNode found allow move effect
              e.Effect = DragDropEffects.Move
          Else
              'No TreeNode found, prevent move
              e.Effect = DragDropEffects.None
          End If
  
      End Sub
  </code></pre>