speed dating p nettet - Call cellvalidating event
In this situation the editor is not kept active when the validation fails and pressing the Esc key does not revert the changes as the editor is already closed.
Canceling this event cancels the changes to the current cell.
I tried calling Validate() but it's not calling the Cell Validating function on every cell Why would you want it to force validation for all cells?
When a cell is modified in any way it is automatically marked as "dirty", when you call data Grid. Validate() you are telling to to check all of the cells which have been modified! If you are saying that this is not happening correctly, or you still want to bypass this great, amazing, fantabulous feature let us know!
I have individual cell validation working when the user edits the cell it calls my cell validating event.
But, I can't get it to validate all cells when a button is pressed.
SOLUTION To achieve data validation prior the row is committed, you can handle the Cell Validating event, which is raised by the control when the current cell changes or when it goes out of edit mode.