So the Cell Validating event cannot be fired when pressing the "Enter" key. The following code example shows how to use this event to validate the cell's value.If you want the Cell Validating event to fire, assign the "Enter" key to the Selection Actions. To run this example, create a windows form, and add a Gc Multi Row control to the form.If the focus is moved to a cell in the same row, then no other events occur.If the focus is moved to a cell in another row, then both Row Validating and Row Validated are fired, containing the whole row data, including the new and the old values of the edited cells.
I wrote code in the cellvalidating event as follows. Data Grid View Cell Validating Eve nt Args) Handles Datagrid1. The Cell Validating event only fires when losing input focus (before leaving the current cell) or when Gc Multi Row validates.The default key setting assigns end edit without leaving the current cell action to the "Enter" key. The problem is now, that the error-symbol (and the error text) is not displayed (in the cell). Cancel the cell looses the focus and error-symbol is displayed.How can I achieve that the cell remains in edit mode and the error-symbol is displayed too?I use Apply Cell Style To Editing Control to apply cell style to the editor in order to apply the same padding.