Board index » delphi » I can't see content of the memo field in DBGrid

I can't see content of the memo field in DBGrid

I have DBGrid with custom table on my form, but I can't see
content of the memo field. I see only text (MEMO) in each row.
What's the problem?

 

Re:I can't see content of the memo field in DBGrid


Maybe there are better ways, but you could add a calculated field and with a
OnGetText like this:

procedure TForm1.Query1StringFieldGetText(Sender: TField; var Text: String;
DisplayText: Boolean);
begin
  Text := Query1.FieldByName('MemoField').AsString;
end;

"Goran" <gesi...@verat.net> schreef in bericht
news:3f45be2d$1@newsgroups.borland.com...

Quote

> I have DBGrid with custom table on my form, but I can't see
> content of the memo field. I see only text (MEMO) in each row.
> What's the problem?

Re:I can't see content of the memo field in DBGrid


Quote
ProDev wrote:
> Maybe there are better ways, but you could add a calculated field and
> with a OnGetText like this:

> procedure TForm1.Query1StringFieldGetText(Sender: TField; var Text:
> String; DisplayText: Boolean);
> begin
>   Text := Query1.FieldByName('MemoField').AsString;
> end;

Don't need the calculated field, just do the above on the memo field itself.

--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
RADBooks: http://www.logicfundamentals.com/RADBooks.html
"It is error alone which needs the support of government. Truth can
stand by itself." - Thomas Jefferson

Re:I can't see content of the memo field in DBGrid


Borland's DBGrid does not support memo fields. You can use a third
party grid or followi Wayne's advice and write an OnGetText event
handler to display the memo text.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)

Other Threads