Rowvalidating event

It still doesn't get called from the rowvalidating event if the ueser elects to continue - why is that?The issue is that the validation event seems to pull information from the row you're entering, as opposed to the row you're leaving.

Row Validating event to try and deal with this and I check the relevant columns all have a value within this event. I am using a Data Grid View bound to a Binding Source that has its Data Source property set to a Data Table within a Data Set in the project.Some of the columns within the Data Table do not alllow null.Steps to recreate are as follows:- Create a form, form1, and set its MDIContainer property to true Create another form, form2, and add a button to form1 that creates an instance of form2 and sets its MDIParent property to form1 Create a Data Set and add a Data Table to it Add a single column to the Data Table and set its Allow DBNull property to false Add a Data Grid View to form2 and link it to the Data Table via a Binding Source component and an instance of the Data Table dragged from the Toolbox Add a button or some other control that you can click to take focus away from the grid Finally add a Row Validating handler to the Data Grid View and add the following code Run the application Click in the cell and press a key so that the row goes into edit mode Now press backspace to delete whatever you typed so the cell is empty (DBNull) Try to click in the textbox......CPU jumps to 100 % and you have to kill the application from Task Manager If you stop form2 from being an MDI child the problem stops occuring and the validation works as expected.

Leave a Reply