DatagridView Letzte Zeile auswählen

Ich habe Probleme beim Einstellen der letzten ausgewählten Zeile in meiner Datagrid-Ansicht. Ich wähle die letzte Zeile so aus:

if (grid.Rows.Count > 0)
{
    try
    {
        grid.Rows[grid.Rows.Count - 1].Selected = true;
        grid.CurrentCell = grid.Rows[grid.Rows.Count - 1].Cells[1]
    }
    catch (IndexOutOfRangeException)
    { }
    catch (ArgumentOutOfRangeException)
    { }
}

Wenn ich diesen Code ausführe, erhalte ich eine Ausnahme:IndexOutOfRangeException occurred: Index-1 hat keinen Wert.

Wenn ich das @ debugRowscollection und das entsprechendeCells collection Ich sehe, dass beide Sammlungen gefüllt sind. Der Index ist auch in der Auflistung "Rows and Cells" enthalten.

Ich habe keine Ahnung, was ich hier falsch mache. Jemand, der mir hier helfen kann? Danke

BEARBEITEN

Hier ist die komplette Ausnahme:

System.IndexOutOfRangeException: Index -1 does not have a value.
at System.Windows.Forms.CurrencyManager.get_Item(Int32 index)
at System.Windows.Forms.CurrencyManager.get_Current()
at System.Windows.Forms.DataGridView.DataGridViewDataConnection.OnRowEnter(DataGridViewCellEventArgs e)
at System.Windows.Forms.DataGridView.OnRowEnter(DataGridViewCell& dataGridViewCell, Int32 columnIndex, Int32 rowIndex, Boolean canCreateNewRow, Boolean validationFailureOccurred)
at System.Windows.Forms.DataGridView.SetCurrentCellAddressCore(Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean throughMouseClick)
at System.Windows.Forms.DataGridView.set_CurrentCell(DataGridViewCell value)

Antworten auf die Frage(14)

Ihre Antwort auf die Frage