Custom datagridview cell selected
<p>When i'm hitting enter key depends on what datagridview cell is selected to run different code.</p>

<p>Example</p>

<pre><code>private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
    {
        if (e.KeyCode == Keys.Enter)
        {
         if (dataGridView1.SelectedCells = dataGridView1.Cells[0])
         {
           dataGridView1.CurrentCell = dataGridView1[1, 0];
         }
         if (dataGridView1.SelectedCells = dataGridView1.Cells[1])
         {
           dataGridView1.CurrentCell = dataGridView1[2, 0];
         }
          if (dataGridView1.SelectedCells = dataGridView1.Cells[2])
         {
           form2 ss = new form2();
           ss.ShowDialog();
</code></pre>

<p>Now i get error Error   System.Windows.Forms.DataGridView' does not contain a definition for 'Cells' and no extension method 'Cells' accepting a first argument of type 'System.Windows.Forms.DataGridView' could be found (are you missing a using directive or an assembly reference?)    </p>