BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TADODataSet and the TField.OnChange event

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Abdullah Kauchali
Guest





PostPosted: Mon Jul 11, 2005 11:36 am    Post subject: TADODataSet and the TField.OnChange event Reply with quote



Got an application that displays a disconnected TADODataset to the user.
The user can change any field. But the moment she "leaves" the record,
I post the record to the database (TADODataSet.AfterPost) [Thanks to
Vitali Kalinin I was able to get the "Delta"! Very Happy].

However, I would like to display a "Save" icon that gets enabled and
disabled after the user "dirties" any single field and saves the record
to the database respectively. (Touch or dirty a field, icon gets
enabled, save the record - icon gets disabled kinda thing.)

Is there any global event on the TADODataSet that I can use to determine
whether the contents of a single field have been changed or is
TField.OnChange (for /each/ field) the only place to do this? In which
case I have to iterate through all the fields on my ADODataset.

Any suggestions appreciated.

Kind regards,

Abdullah
Back to top
Kostas Terzides
Guest





PostPosted: Mon Jul 11, 2005 2:29 pm    Post subject: Re: TADODataSet and the TField.OnChange event Reply with quote



Abdullah Kauchali wrote:
Quote:
Got an application that displays a disconnected TADODataset to the user.
The user can change any field. But the moment she "leaves" the record,
I post the record to the database (TADODataSet.AfterPost) [Thanks to
Vitali Kalinin I was able to get the "Delta"! Very Happy].

However, I would like to display a "Save" icon that gets enabled and
disabled after the user "dirties" any single field and saves the record
to the database respectively. (Touch or dirty a field, icon gets
enabled, save the record - icon gets disabled kinda thing.)

Is there any global event on the TADODataSet that I can use to determine
whether the contents of a single field have been changed or is
TField.OnChange (for /each/ field) the only place to do this? In which
case I have to iterate through all the fields on my ADODataset.

Any suggestions appreciated.

Kind regards,

Abdullah

I would probably use Actions and handle Action OnUpdate event:

ActionSave.Enabled:=AdoDataSet.UpdatesPending

or something like that

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.