Private Sub DataGridView1_DragDrop(sender As Object, e As DragEventArgs) Handles DataGridView1.DragDrop Dim dgv As DataGridView = CType(sender, DataGridView) Dim dt As DataTable = dgv.DataSource If CurrentIndex = -1 Then Exit Sub End If '移動先の行を取得 Dim p As New Point(e.X, e.Y) Dim cp As System.Drawing.Point = dgv.PointToClient(p) Dim hit As DataGridView.HitTestInfo = dgv.HitTest(cp.X, cp.Y) 'Dim hit As DataGridView.HitTestInfo = dgv.HitTest(e.X, e.Y) Dim targetIndex As Integer = hit.RowIndex '移動元のデータを削除 dt.Rows.RemoveAt(MoveIndex) '移動先の行に新しい行を作成 Dim ndr As DataRow = dt.NewRow ndr.ItemArray = DragObject '移動元のデータを設定 dt.Rows.InsertAt(ndr, targetIndex) '移動先の行に挿入 dgv.CurrentCell = dgv(hit.ColumnIndex, targetIndex) '…① CurrentIndex = -1 MsgBox(dgv.CurrentCell.ToString) '…② End Sub