Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-04

TField.OnGetText Event (TDBLookupComboBox)

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Allan E. Registos

Hi all,

I am fighting with this memo output text on TDBLookupComboBox control.

I have this db query: SELECT (flute.flute || '-') || flute.description AS flute FROM flute;
and there are some similar queries. In a TDBGrid, we can let the output as is as the query result and not the (MEMO) output by using the TDBGrid's PrepareCanvas and the OnGetText events using this class:

MyMemoClass = class
public
procedure DBGridOnGetText(Sender: TField; var aText: string;
DisplayText: boolean);
end;
....
procedure MyMemoClass.DBGridOnGetText(Sender: TField; var aText: string;
DisplayText: boolean);
begin
if (DisplayText) then
aText := Sender.AsString;
end;

Then the final declaration at TDBGrid's PrepareCanvas event:

var
mGetExactString: MyMemoClass;
Begin
TDBGrid1.Columns.Items[x].Field.OnGetText := @mGetExactString.DBGridOnGetText;
end;

Is there a way I can do this similarly with TDBLookupComboBox control? I'm trying to find the similar PrepareCanvas and OnGetText events from TDBLookupComboBox but I find nothing...

Regards,
Allan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140426/f1fe77ff/attachment.html>

Reply by email