Link to home
Create AccountLog in
Avatar of lgallion
lgallion

asked on

Validate DevExpress Quantum Grid Field before Post

I am using Delphi and DevExpress Quantum Grid 6.  Sometimes users don't fill in the necessary entries before posting which generates SQL "cannot insert NULL" errors in the application.  I have tried to fix this on the Dataset level but canceling the post makes the user lose the data they have entered without any warning (not a very good solution).  Is there any way to check the entries for empty (null) values before being passed to the dataset for posting?  I can't simply check in the field exit because often the users simply skip the fields or accidentally click on another row causing a pre-mature post.
Avatar of dprochownik
dprochownik
Flag of Poland image

There is high propability, that yours grid is not responsible for that error, which is generated by db controls used by yours grid as data source. Most db query controls has event before post, where you can validate all data. If you call Abort in before post event, posting will be aborted and db control will stay in editing/inserting mode.
Avatar of lgallion
lgallion

ASKER

dprochownik, the grid is not responsible for the error, I just want to find out how to check at the grid level before it gets to the data controller.  Unfortunately there is not a published before post event on Quantum Grid 6 (it still exists but it is hidden, which makes me assume I am not supposed to use it, but I can't figure out how what is the preferred alternative).
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Thanks kretzschmar, I was doing both a Cancel and an Abort in the Before Post when only an Abort was necessary.