Subject: Validations...
Posted By: Flunders Post Date: 3/15/2004 1:56:19 PM
Hello

I've got my flexgrid set up and various text boxes.  Once information has been entered into the text boxes and the command button executed the information is entered into the flexgrid.  How do I validate it so it comes up with an error if I enter into the wrong information... like using numbers where text should be, for example.

Please help
Thanks
Flunders
Reply By: Shane Reply Date: 3/27/2004 6:27:17 AM
There are quite a few ways to do this ... just depends at which point you want to do the checking. The textbox keypress event, validate event (caveat: only triggered if control you are moving to has 'causesvalidation' property set to true), change event. If you are doing field level validation for basic alphanumeric filtering then the keypress event is a good place to start. If you have more complex needs, the validate event might be more appropriate.

HTH.

Shane.

Reply By: Lalit_Pratihari Reply Date: 9/28/2004 10:48:12 AM
Hi,

Shane is right. Validation could be control level or form level.
If you want a field level validation then you have to check for the value in keypress, change or lostfocus events.
And if you want to have a form level validation then you will have to validate the entries once you feed in the value into the various controls and while saving it into the flexgrid control.

Hope this helps,

Lalit
Life Means More...
Reply By: Anantsharma Reply Date: 9/29/2004 7:09:39 AM
Well u can create  a class module to which u can pass the control and validate its value varifying the datatype required. I suggest to create matrix (table) whic will hold the control name in Controls collection and its valid datatype datatype. In this way u can loop through the controls, pass the control name, it will pick datatype from table and validate through code and return an error value (should be string type so that u can from an error string in class odule).

Hope u got my point.

B. Anant

Go to topic 19934

Return to index page 760
Return to index page 759
Return to index page 758
Return to index page 757
Return to index page 756
Return to index page 755
Return to index page 754
Return to index page 753
Return to index page 752
Return to index page 751