title: ListView Drag/Drop reordering - doesn't work when dragging left
body: <p>As the title really - I have some code for reordering some thumbnails in a ListView ('LargeIcon' view format), and it works great when dragging an image to the right (i.e. a greater index). But when dragging to the left it doesn't work at all.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>  private void lstImages_ItemDrag(object sender, ItemDragEventArgs e)
      {
          lstImages.DoDragDrop(lstImages.SelectedItems, DragDropEffects.Move);
      }
  
      private void lstImages_DragEnter(object sender, DragEventArgs e)
      {
          if (e.Data.GetDataPresent(typeof(ListView.SelectedListViewItemCollection)))
          {
              e.Effect = DragDropEffects.Move;
          }
      }
  
      private void lstImages_DragDrop(object sender, DragEventArgs e)
      {
          if (lstImages.SelectedItems.Count == 0) return;
  
          Point p = lstImages.PointToClient(new Point(e.X, e.Y));
          ListViewItem dragToItem = lstImages.GetItemAt(p.X, p.Y);
  
          if (dragToItem == null) return;
  
          int dragIndex = dragToItem.Index;
  
          ListViewItem dataItem = (e.Data.GetData(typeof(ListView.SelectedListViewItemCollection)) as ListView.SelectedListViewItemCollection)[0];
          int itemIndex = dragIndex;
          if (itemIndex == dataItem.Index) return;
  
          itemIndex = itemIndex + 1;
  
          ListViewItem insertItem = (ListViewItem)dataItem.Clone();
          lstImages.Items.Insert(itemIndex, insertItem);
          lstImages.Items.Remove(dataItem);
      }
  </code></pre>