Good day,
Yesterday I spent almost a whole afternoon to get TStringgrid to do what I want (which works very easy and well in Delphi but not in Lazarus 2.0.2.
I want to create a grid on a form at runtime.
Several code examples found, nothing works.
Example:
MyGrid := TStringGrid.Create(Self);
MyGrid.Parent := Self;
MyGrid.Visible := true;
MyGrid.left := 20;
MyGrid.top := 20;
MyGrid.rowcount := 5;
MyGrid.colcount := 5;
MyGrid.width := 100;
MyGrid.height := 100;
MyGrid.Enabled := true;
MyGrid.cells[1, 1] := 'hi';
NOTHING visible on the form. Changing parent to form name or create on form name in stead of Self does not change anything: always empty form.
Tried also with an empty grid at design time and then changing rows and columns (yes: with the columns.add, not by only changing colcount) at runtime but changes are not visible: the design time version is always displayed. No refresh, repaint, invalidate, ... helps.
Why does this not work?
As the stringgrid works very easily under Delphi but is a REAL pain in the ass in Lazarus (a lot of stupid error messages in other applications also), I really think the Stringgrid component of Lazarus really sucks. I'm a wrong?
Is there an important item that I don't know to make the Stringgrid of Lazarus work as easily as the Stringgrid of Delphi?
Thanks!