Download Source (VB.net 2010)
This a sample code how to moving DataGridView rows item with drag and droping, you can move item to every line, check it!
I using this code for get the index of rows where user droping a data:
Private Sub DataGridView1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles DataGridView1.DragDrop
Dim CP As Point = DataGridView1.PointToClient(New Point(e.X, e.Y))
Dim RowDestination As Integer = DataGridView1.HitTest(CP.X, CP.Y).RowIndex
Dim RowSource As Integer = e.Data.GetData("System.String")
If RowDestination >= 0 Then
Dim tmp(0 To DataGridView1.Rows(0).Cells.Count - 1)
'saving Cells
For i = 0 To tmp.Count - 1
tmp(i) = DataGridView1.Rows.Item(RowSource).Cells(i).Value
Next
DataGridView1.Rows.RemoveAt(RowSource)
DataGridView1.Rows.Insert(RowDestination, 1)
'Aplly Saved Cells
For i = 0 To tmp.Count - 1
DataGridView1.Rows(RowDestination).Cells(i).Value = tmp(i)
Next i
DataGridView1.Rows(RowDestination).Selected = True
End If
End Sub
Read More!