DataGridView and the CellEndEdit Event

Posted by Brandon on Stack Overflow See other posts from Stack Overflow or by Brandon
Published on 2010-01-27T14:49:48Z Indexed on 2010/06/14 15:32 UTC
Read the original article Hit count: 183

Filed under:
|
|
|

I have a DataGridView, and would like to hook into the CellEndEdit event. I've been able to successfully hook into the CellContentClick event, but am having issues with CellEndEdit.

I added the following code to my Form1.cs file:

private void dataGridView1_CellEndEdit(object sender, DataGridViewCellCancelEventArgs e) { dataGridView1[0, 0].Value = "Changed"; }

With that code, nothing happens when I am done editing a cell. Is there anything else that I need to do to successfully hook into this event? I see that CellContentClick has a this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); line of code in the Form1.Designer.cs file, but I tried to mimic this for CellEndEdit, and received a compile error (No overload for 'dataGridView1_CellEndEdit' matches delegate 'System.Windows.Forms.DataGridViewCellEventHandler')

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET