Datagridview cell validating
Place a new Timer (Components Tab) inside the Form. Now put this code in your Cell Validating event: You can't do what you want because the validation process does not allow to change the cell value during validation.
So, any change you do inside the Cell Validating event will be ignored. Inside the Cell Validating event you set the Tag property of the Timer with the Row Index, the Column Index and the cell value that you want to assign to the cell, and finally you activate the Timer.
To String Your requirements: I could easily do this using Cell Value Changed but I don't want the user to be able to leave the cell if the zip Code is not don't you just have a Cell Leave and have a flow like:if column = Zip Code 'validate zip if valid 'exit sub else 'set focus to current cell end ifend_ifthen do all you other processing in the Validating -Sometimes the answer to your question is the hack that works I tried your code and it works fine but it changes the value of the textbox but it doesn't change the value of the cell.
But when I go to the next row and I want to add another value in the reference cell and then it will fill the other like the first one, it didn't do it... My app is a sort of cash register for a shop so in the datagrid there is Reference ,it is the reference of the product.
I tried sender = dgv Sender and the data Grid View cell still doesn't take the new value.
-Sometimes the answer to your question is the hack that works I changed the textboxes to variables on your code and ran it fine and it correctly changed dvg Test but that still didn't help me change the cell value.
I have a Data Grid View that I am using the Cell Validating event when the User tabs out of a cell.ALSO, I tried to put the total of the bill in the datagrid...