How can one disable the first autoselect in a VS datagridview?

You should call: ClearSelection after event: DataBindingComplete


I had the same problem and here is my solution.

The tricky part was finding where to clear the selection... We can only clear the selection after the selection has been set by the DataGridView. At first the selection is only ready to be cleared in the Form.Load event, but subsiquent settings of the DataGridView.DataSource the selection is ready to be cleared straight after the DataSource assignment.

public class DataGridView_AutoSelectSuppressed : DataGridView
{
    private bool SuppressAutoSelection { get; set; }

    public DataGridView_AutoSelectSuppressed() : base()
    {
        SuppressAutoSelection = true;
    }

    public new /*shadowing*/ object DataSource
    {
        get
        {
            return base.DataSource;
        }
        set
        {
            SuppressAutoSelection = true;
            Form parent = this.FindForm();

            // Either the selection gets cleared on form load....
            parent.Load -= parent_Load;
            parent.Load += parent_Load;

            base.DataSource = value;

            // ...or it gets cleared straight after the DataSource is set
            ClearSelectionAndResetSuppression();
        }
    }

    protected override void OnSelectionChanged(EventArgs e)
    {
        if (SuppressAutoSelection)
            return;

        base.OnSelectionChanged(e);
    }

    private void ClearSelectionAndResetSuppression()
    {
        if (this.SelectedRows.Count > 0 || this.SelectedCells.Count > 0)
        {
            this.ClearSelection();
            SuppressAutoSelection = false;
        }
    }

    private void parent_Load(object sender, EventArgs e)
    {
        ClearSelectionAndResetSuppression();
    }
}

Hope this helps.