//Below Code is not working and i am not able to find the errror...... 
 
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                int col = dataGridView1.CurrentCell.ColumnIndex;
                int row = dataGridView1.CurrentCell.RowIndex;
                if (col < dataGridView1.ColumnCount - 1)
                {
                    col++;
                }
                else
                {
                    col = 1;
                    row++;
                }
                if (row == dataGridView1.RowCount)
                {
                    dataGridView1.Rows.Add();
                    dataGridView1.CurrentCell = dataGridView1[col, row];
                    e.Handled = true;
                }
            }
        }