private void Form1_Load(object sender, EventArgs e) { this.dataGridView1.Columns.Add("c1", "c1"); this.dataGridView1.Columns.Add("c2", "c2"); this.dataGridView1.Rows.Add(); this.dataGridView1.CellValidating += new DataGridViewCellValidatingEventHandler(dataGridView1_CellValidating); } void dataGridView1_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) { if (e.ColumnIndex == 0) { if(this.dataGridView1.CurrentCell.EditedFormattedValue!=null) { Console.WriteLine("CurrentCell.EditedFormattedValue" + this.dataGridView1.CurrentCell.EditedFormattedValue.ToString()); } if (this.dataGridView1.CurrentCell.Value != null) { Console.WriteLine("CurrentCell.Value " + this.dataGridView1.CurrentCell.Value.ToString()); } Console.WriteLine(""); } } protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == Keys.F2) { Form2 f = new Form2(); f.ShowDialog(); this.dataGridView1.CurrentCell.Value = f.Code; } return base.ProcessCmdKey(ref msg, keyData); }