Link to home
Start Free TrialLog in
Avatar of nadernabil
nadernabil

asked on

dbgrid

how i can make a validation by field_level within the dbgrid , on another way how i can check a text that i input it in a column if it is correct or not and if it's not i want to prevent the curssor from the moving to another cell(by press the return key) untel input a correct data
Avatar of marcgale
marcgale

I would check that the text is valid and then return the cursor to the cell (and blank it out, if necessary) if the check determined the text to be invalid.
Check out the event:

DBGrid1_BeforeColUpdate

In this event , you can validate the new value, track the old value, and cancell the update if your validation requires it !!

hope this would help!!
ASKER CERTIFIED SOLUTION
Avatar of gkakas
gkakas
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hey gkakas ,

I thought that was what i just suggested.
Dear Sidneym,

Sorry if it is so, I am new here and saw no info about getting current value and I think it is not obvious that you have to read the grid text to get it, although it is necessary for the validation of data.

But if you still feel I should withdraw the answer send an email to gkakas@otenet.gr  and I will do it immediatelly.

Yours sincerelly George Kakaletris
gkakas ,

no need , its ok ..after all the goal is to give advice to those who need it.

Cheers!