There are two ways to manage unwanted execution of event handlers. Data Grid View Cell Validating Event Args' does not contain a constructor that takes '1' arguments" what is the solution for this???????
1) Add a conditional statement in the event handler code to only execute when required. Cell Validating -= new Data Grid View Cell Validating Event Args(dgv Sub Contractor_Cell Validating); it says that "Error 7 'System. hey what do ouy mena by the below private void data Grid View1_Cell Validating(object sender, Data Grid View Cell Validating Event Args e) if (adding Row) - is to call the button event for adding a new row is it every time the cell validating event triggers and a value is entered in the datagridview cell right??
I'm trying to do entry validation in a Data Grid View.1) Add a conditional statement in the event handler code to only execute when required.2) Detach the event hander before the unwanted event triggers and re-attach after.Moving focus from the text box to any other control on the form will fire the validating event ( that too if the Causes Validation property of the control receiving focus is set to true.True is by the way the default setting) Now for the solution: When a control belongs to a parent control - you should set the causes validation of the Parent to false, if you want the kind of behaviour I wanted.I understand that using the Cell Validating has a drawback.