 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Mike Zmuda Guest
|
Posted: Fri Sep 08, 2006 2:56 am Post subject: Memo fields in TDBGrid |
|
|
Hello,
Does anybody know how to get a TDBGrid to display Memo fields from a database?
I've tried doing things with the DrawDataCell event, but it doesn't even
trigger.
procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
Field: TField; State: TGridDrawState);
Var
P : Array[0..50] of Char;
BS : tBlobStream;
S : String;
begin
S := '';
If Field is TMemoField then Begin
With (Sender as TDBGrid).Canvas do Begin
BS := tBlobStream.create(TBlobField(Field),bmRead);
FillChar(P,SizeOf(P),#0);
BS.Read(P,50);
BS.Free;
S := StrPas(P);
While Pos(#13,S) > 0 do S[POS(#13,S)] := ' ';
While Pos(#10,S) > 0 do S[Pos(#10,S)] := ' ';
FillRect(Rect);
TextOut(Rect.Left,Rect.Top,S);
end;
end;
end;
What am I doing wrong / is there an easier way to get the TDBGrid to display a
memo field?
(Specifically, I'm not looking for another component to display memo fields - I
have those. I'm looking to see the specific memo using the default TDBGrid
component that ships with Delphi 2006.)
Thanks -
Mike Z. |
|
| Back to top |
|
 |
Riki Wiki Guest
|
Posted: Fri Sep 08, 2006 7:42 am Post subject: Re: Memo fields in TDBGrid |
|
|
Hoi Mike
You need to repost your question on the Borland news server to make
everybody see it and possibly answer your question. Further, this news
group do not officially exist, the group to use is b.p.d.database.general.
How to post to Delphi newsgroups:
<http://delphi.wikia.com/wiki/Delphi_Newsgroups> |
|
| Back to top |
|
 |
|
|
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 vote in polls in this forum
|
|