Jump to content

DBComboBox RemoteQuery


dkeene

Recommended Posts

Hello

I am trying to use RemoteQuery on a DBComboBox to build a query based on the value of the DBComboBox's textbox as a user types some keys.

Instead of using the event: DBComboBox.OnChange(Sender: TObject) to process the request, i will set property RemoteQuery to True, and  will now use

uniDBComboBoxRemoteQuery(const QueryString: string; Result: TStrings); to grab the value of QueryString and build an SQL statement.

However, unlike OnChange(Sender: TObject), now I don't have any knowledge of which control is triggering this event. Is there any way of grabbing the sender of this event and why is it not included in as something like

DBComboBoRemoteQuery(Sender: TObject; const QueryString: string; Result: TStrings);

Please help

Thanks

Doug

Link to comment
Share on other sites

Perhaps one could use the form's ActiveControl property, but I try during the 

procedure TForm.DBComboboxRemoteQuery(const QueryString: string; result: TStrings);

begin

   if self.ActiveControl is UniDBCombobox then
      begin
         ....do something

      end;

 

end

 

Despite the control that triggers this event, Self.ActiveControl is nil...

Any thoughts?>

Doug

Link to comment
Share on other sites

  • 3 years later...

Issue was to have sender(DBComboBox) so you just can write one function in which you can use (sender as TUniDBComboBox)... .

i found solution already, there is second event called: 

RemoteQueryEx(Sender: TComponent;  const QueryString: string; Result: TStrings);

 

where the sender is given.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...