[Lazarus] TField.OnGetText Event (TDBLookupComboBox)
Allan E. Registos
allan.registos at smpc.steniel.com.ph
Sat Apr 26 02:57:39 CEST 2014
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-ide.org/pipermail/lazarus/attachments/20140426/f1fe77ff/attachment-0002.html>
More information about the Lazarus
mailing list