 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Thu Feb 01, 2007 3:28 pm Post subject: DataSource.AutoEdit with Data aware controls problem |
|
|
I have a form with several data aware controls connected to a
datasource.
I want the user to be able to edit the values in the controls but
these values will no be written to the database
before they click on a Tbutton which will make the Commit/update to
the DB.
If I set the Datasource's AutoEdit Property is set to false then the
user cannot change the values of the controls at all.
Is there any way to do such a thing? |
|
| Back to top |
|
 |
GuidoSkynet Guest
|
Posted: Sun Apr 29, 2007 7:27 pm Post subject: Re: DataSource.AutoEdit with Data aware controls problem |
|
|
<tzvikaz (AT) gmail (DOT) com> wrote:
| Quote: | I want the user to be able to edit the values in the controls but
these values will no be written to the database
before they click on a Tbutton which will make the Commit/update to
the DB.
If I set the Datasource's AutoEdit Property is set to false then the
user cannot change the values of the controls at all.
Is there any way to do such a thing?
|
When the user is allowed to change a record, enable / disable a few TButtons
with captions such as: "Edit", "Save" and "do NOT save".
btnEdit.Enabled := True;
btnPost.Enabled := False;
btnCancel.Enabled := False;
When the user clicks btnEdit, set the table in "edit" state:
Table1.Edit;
btnPost.Enabled := True;
btnCancel.Enabled := True;
btnEdit.Enabled := False;
When btnPost is clicked:
Table1.Post; // data is saved
btnEdit.Enabled := True;
btnPost.Enabled := False;
btnCancel.Enabled := False;
When btnCancel is clicked:
Table1.Cancel; // data is not saved
btnEdit.Enabled := True;
btnPost.Enabled := False;
btnCancel.Enabled := False;
Good luck!
Guido, DelphiLand Team |
|
| Back to top |
|
 |
|
|
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
|
|