Jump to content

TUniDbGrid with (MEMO) field


ainsama1

Recommended Posts

 

Hi,

I have this Grid that shows the PC parts. But instead of displaying the Items, it displayed "(Memo)". image.thumb.png.86ab4061926bbe081157364fa6615f79.png

I've read many threads it says it can be done like this:

procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
  Field: TField; State: TGridDrawState);
var
  S: String;
begin
  if Field.DataType = ftMemo then
    begin
     S := Field.AsString;
      DBGrid1.Canvas.Pen.Color := clWindow;
      DBGrid1.Canvas.Brush.Color := clWindow;
      DBGrid1.Canvas.Rectangle(Rect);
      DBGrid1.Canvas.TextOut(Rect.Left, Rect.Top, S);
   end;
end;

But the UniDBGrid1.Canvas shows error. May i know your suggestions. Thanks

 

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...