C# Datagridview Edit Cell <p>I'm trying to put the cursor and focus in the last row and a specific cell with the column named 'CheckNumber'. I thought I had it with this:</p> <pre><code> var c = dataGridView1.RowCount; DataGridViewCell cell = dataGridView1.Rows[c-1].Cells[0]; dataGridView1.CurrentCell = cell; dataGridView1.BeginEdit(true); </code></pre> <p>but it keeps coming up with this error:</p> <p>Index -1 does not have a value.</p> <p>Can someone please point me in the right direction!? This is driving me nuts.</p> <p>Thank you!</p>