Datagridview validating edit
Cells("Zip Code").value = new Zip Valuethe new value doesn't get accepted. You may be able to cancel the event, instead of setting the cell value. e.formatted Value holds the current value but it's read Only so I can't change the value there either. -Sometimes the answer to your question is the hack that works Private Sub dgv Test_Cell Leave(By Val sender As System. I know there is a Row Validating event but i'm not sure how to use that in my case. Data Grid View Cell Validating Event Args]$_ $msg='Row: Column: Value:' -f $ea. The escape causes the row to be reverted or it jsut cancels the edit. A structured presentatiopn will save you a lot of time and guesswork.Copy of the code is attached.uploads/35332/2-Bulk-Create hooon2012-02-12 $ea = [System. You might also search for web tutorials on WIndows FOrms validation. Once you start fighting your own code, it turns into a mess, you have to consolidate the logic and hope you didn't miss a way to bypass your checks. You may have to move all the logic related to validating that data from the Validating, to the Cell Leave, and just assume that the data there is good. Error Text = "the value must be a non-negative integer" $ea.
Cancel=$true Thanks for that link, unfortunately that didnt help as i just cant get it to reset the form.
-Sometimes the answer to your question is the hack that works Thanks for the suggestion,sender.