Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 28 Mar 2024, 20:51

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 28 Nov 2022, 11:15 
Offline

Joined: 13 Jun 2012, 14:17
Posts: 15
Hi,

I want to edit and Update a a DBGridEh-cell and want to use a own Update Qry to save the data in the database. DBGridEh is bind to this own dataset.
Which are the right Events to do this? (Read Input data and Update Data in database)

The worflow shoud be used like:
1. Edit a value in a Column (Amount)
2. press return => Start Update-Qry and Jump to next cell (down) in Column (Amount)


Top
 Profile  
 
PostPosted: 30 Nov 2022, 11:31 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

Try to use TColumnEh.OnUpdateData event:

Here is an example:

Code:
procedure TForm1.DBGridEh1Columns3UpdateData(Sender: TObject; var Text: string;
  var Value: Variant; var UseText, Handled: Boolean);
var
  Column: TDBGridColumnEh;
begin
  Column := Sender as TDBGridColumnEh;

  Column.Field.DataSet.Edit;
  Column.Field.Text := Text;
  Column.Field.DataSet.Post;

  Handled := True;
end;

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 11 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group