Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 27 Apr 2024, 15:36

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 14 Mar 2024, 02:04 
Offline

Joined: 06 Sep 2016, 02:27
Posts: 19
good day!
I have a question about how to do it
I have the component TDBLookupComoboboxEh (it is linked to a table field) and I select something from the list
Why does it not update the field in the table until I press the tab or enter key? Is there a way to avoid pressing those keys or so that when you select it updates automatically?
Excuse me but my English is bad


Top
 Profile  
 
PostPosted: 18 Mar 2024, 08:24 
Offline

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

TDBLookupComboboxEh inherits from TCustomDBEditEh and inherits all the behavior of TDBEditEh, and is compatible with the standard TDBEdit component i.e. writes data to a DataSet field only when the control leaves input focus or the user presses Enter.

You can force TDBLookupComboboxEh to write data to the field if you do it manually in the OnChange event handler like this:

Code:
procedure TForm1.DBLookupComboboxEh1Change(Sender: TObject);
begin
  if DBLookupComboboxEh1.Focused and
     DBLookupComboboxEh1.Modified then
  begin
    if MemTableEh1.State in [dsEdit, dsInsert] then
      DBLookupComboboxEh1.UpdateData;
  end;
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 63 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:  
Powered by phpBB® Forum Software © phpBB Group