title: How do I mimic Windows Explorer multi-select/drag-n-drop behavior in a DataGridView?
body: <p>I'm trying to mimic the way Windows Explorer handles multiple selection.  In a default DataGridView, you can select multiple items using Ctrl-click.  But if you release the Ctrl key and then try and drag/drop the selected items, it clears the selected items and only selects the "hit" row.  I found the following solution somewhere online.</p>
  
  <pre><code>protected override OnMouseDown(MouseEventArgs e)
  {
    int hitRowIndex = HitTest(e.X, e.Y).RowIndex;
    if(!SelectedRows.Contains(Rows[hitRowIndex]))
    {
      base.OnMouseDown();
    }
  }
  </code></pre>
  
  <p>However, this causes other side effects.  With the CTRL key pressed and mousing down on a selected item, the item remains selected.  This makes sense because the mousedown event is bypassed if the row clicked on is selected.  From looking at the behavior of Windows Explorer, it looks like the deselection of an item with the CTRL key held is not handled until the MouseUp event.  Has anyone tried to do this?</p>