Recent

Author Topic: [tiOPF] create records in stringgrid but see no data  (Read 2153 times)

mangakissa

  • Hero Member
  • *****
  • Posts: 1131
[tiOPF] create records in stringgrid but see no data
« on: September 09, 2014, 03:54:45 pm »
Regarding the address book demo 21 I tried to create a small application myself.
With help of the address book I created a form with a stringgrid. When I start my application, I can see two rows added but no data will be displayed.
Did I have something wrong?
Lazarus 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

Graeme

  • Hero Member
  • *****
  • Posts: 1527
    • Graeme on the web
Re: [tiOPF] create records in stringgrid but see no data
« Reply #1 on: September 10, 2014, 02:05:37 pm »
The mediators (MGM) use RTTI by default, so to get access to the TArticle properties, you must make them published (thus enabling RTTI access in your class).

Code: [Select]
  public
    constructor Create(const aID, aArticle, aCultivar, aKind, aSize : string); reintroduce;
  published
    property ID       : string read FID write SetFID;
    property Article  : string read FArticle write SetArticle;
    property Cultivar : string read FName write FName;
    property Kind     : string read FKind write SetKind;
    property Size     : string read FSize write SetSize;

All should then be fine - it works here. Tested under Win7 (64-bit).

ps: The tiOPF newsgroup server is back up and running. So if you could post future tiOPF questions there it would be much appreciated. Others could then benefit from questions and answers.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

 

TinyPortal © 2005-2018