Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password

Programming > Pascal Delphi Misc > Re: This looked...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 6 Topic 6032 of 6153
Post > Topic >>

Re: This looked simple...

by "Stark" <franco.jommi@[EMAIL PROTECTED] > Apr 3, 2008 at 02:39 PM

But the value typed into the DBGrid cell is not written into the dataset 
field up to a Post statement as far as I understand.
If ItemsQty is the dataset field, isn't the validation control executed
too 
late ?
I am going to look into the example you mentioned... Thanks anyway.

"sap" <sap@[EMAIL PROTECTED]
> ha scritto nel messaggio 
news:ft1513$bok$1@[EMAIL PROTECTED]
> "Stark" <franco.jommi@[EMAIL PROTECTED]
> wrote in message
> news:47f40918$0$36440$4fafbaef@[EMAIL PROTECTED]
>> How do I identify what digitized by the user into a DBGrid cell ( in 
>> order
>> to validate it before it is written to the dataset) ?
>> I tried different statements (DBGrid1.Fields[4].Value etc. ), but
didn't
>> find the right one. Can anyone help ?
>
> You never validate DbGrid cell contents, but the Field content you are 
> going
> to write to the database.
>
> Let's say in your ITEMS.DB table you have field 'Qty', and you view that
> table content through a TTable or TQuery components that are again
linked 
> to
> TDbGrid control.
>
> Then you would use one of those *events* that TTable or TQuery
generously
> offer for each of the underlying database fields.
>
> procedure TForm1.ItemsQtyValidate(Sender: TField); // ItemsQty  field
> validation.
> begin
>  if ItemsQty.Value < 1 then
>    raise Exception.Create('Must specify quantity');
> end;
>
> You better locate the MastApp demo from the delphi \DEMOS sub directory,

> and
> start to investigate that.
>
> You'll find the similar code snippet like above from the DATAMOD.PAS
unit.
>
> -sap
>
>
 



 6 Posts in Topic:
This looked simple...
"Stark" <fra  2008-04-03 00:31:39 
Re: This looked simple...
"sap" <sap@[  2008-04-03 02:25:22 
Re: This looked simple...
"Stark" <fra  2008-04-03 14:39:12 
Re: This looked simple...
sap <sap@[EMAIL PROTEC  2008-04-03 17:48:13 
Re: This looked simple...
"Stark" <fra  2008-04-03 17:56:33 
Re: This looked simple...
sap <sap@[EMAIL PROTEC  2008-04-04 11:28:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 7 16:24:09 CDT 2008.