If I never double-click on a freshly created DataGridView control, the dataGridView1_CellContentClick() handler is not created, yet the application builds and runs without any problem.
But once I create this dataGridView1_CellContentClick() handler by double-clicking the DataGridView control, then delete it, I receiving this build failure:
error CS1061: ‘App1.Form1’ does not contain a definition for
‘dataGridView1_CellContentClick’ and no extension method
‘dataGridView1_CellContentClick’ accepting a first argument of type
‘App1.Form1’ could be found (are you missing a using directive or an
assembly reference?)
Why?
How does the framework know that I created it?
Is there a correct way of removing this handler?
You’ll have to delete it from the designer.cs file as well as from your code behind code.
In the error list, just dbl click the error. It will take you there.
Cheers