Jump to content


Photo

bugfix: Memo field display [MEMO] instead of real text


  • Please log in to reply
1 reply to this topic

#1 famaz

famaz
  • Members
  • 1 posts

Posted 12 October 2007 - 10:31 AM

Hello,
i'va had this problem and found a solution i want to share with you.

In case you use KaDao for Access database the memo fields content is shown as [MEMO] in grid column.
it's not a problem of NxDbGrid itself because with other database it's ok but the change is needed in it because other Grids show the correct values.
the solution is to read, in case of memo field, the text and not the displaytext from field:

in file NxDbGrid.pas

in function TNextDBGrid.GetCellInfo(ACol, ARow: Integer): TCellInfo;

change from

CODE
    { Set DisplayText }
    if DataField.IsNull then DisplayText := Columns[ACol].NullText else
    begin
      if DataType = ftWideString then DisplayText := TWideStringField(DataField).Value
        else DisplayText := DataField.DisplayText;
      end;
    end;


to

CODE
    { Set DisplayText }
    if DataField.IsNull then DisplayText := Columns[ACol].NullText else
    begin
      case DataType of
       ftWideString: DisplayText := TWideStringField(DataField).Value;
       ftMemo: DisplayText := DataField.AsString
        else DisplayText := DataField.DisplayText;
      end;
    end;



that's all wink.gif .
bye
Fabio

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,923 posts
  • Gender:Male

Posted 12 October 2007 - 11:12 PM

Hello Fabio,

I have add this behaviour in first versions of NextDBGrid, but this causes a slowdown when Memo field was large sad.gif

I will need to add some property for controling this. Maybe inside Column.DataAwareOptions new flag, daDisplayMemoContent

I hope that this solution will be the best.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users