Recent

Author Topic: TCustomStringGrid vs TStringGrid  (Read 7686 times)

cazzajay

  • Jr. Member
  • **
  • Posts: 94
TCustomStringGrid vs TStringGrid
« on: September 20, 2011, 11:22:14 am »
Hi all

I am after a basic string grid that can load and save a CSV format file.  I note that there is a component mentioned in the documentation (http://lazarus-ccr.sourceforge.net/docs/lcl/grids/tcustomstringgrid.loadfromcsvfile.html) called Custom String Grid, apparently in grids.pas.

However, I cannot find it in the components of the IDE at the top - I can only find TStringGrid which does not appear to have a LoadFromCSVFile procedure.

Is this the same control but renamed? If so, is it possible to load and save a CSV file in it? TStringGrid seems to require an XML specification which leads me to think it might be a different component altogether, in which case, how do I get a TCustomStringGrid on my form?

Any help appreciated - thanks!

James
Windows XP 32 bit / Lazarus 1.0.6 / FPC 2.6.0

IPguy

  • Sr. Member
  • ****
  • Posts: 385
Re: TCustomStringGrid vs TStringGrid
« Reply #1 on: September 26, 2011, 03:10:12 am »
James,

there is a SaveToCSVFile(); method for the standard stringgrid.
I believe it was recently added.
I'm using 0.9.31-32432-2.5.1-win32.

cazzajay

  • Jr. Member
  • **
  • Posts: 94
Re: TCustomStringGrid vs TStringGrid
« Reply #2 on: September 26, 2011, 11:04:02 am »
Thanks IPGuy.

I don't see that version on SourceForge. Has it been released to Binary yet?
Windows XP 32 bit / Lazarus 1.0.6 / FPC 2.6.0

Shebuka

  • Sr. Member
  • ****
  • Posts: 429
Re: TCustomStringGrid vs TStringGrid
« Reply #3 on: September 26, 2011, 11:08:53 am »
Thanks IPGuy.

I don't see that version on SourceForge. Has it been released to Binary yet?
Look at Daily Snapshots

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: TCustomStringGrid vs TStringGrid
« Reply #4 on: September 26, 2011, 02:49:11 pm »
See declaration of TStringGrid:
Code: [Select]
{ TStringGrid }

  TStringGrid = class(TCustomStringGrid)
  protected
    class procedure WSRegisterClass; override;
  public
    property Modified;
  published
    property Align;
    property AlternateColor;
    property Anchors;
    property AutoAdvance;
    property AutoEdit;
    property AutoFillColumns;
    property BiDiMode;
    property BorderSpacing;
............. etc.
As you can see, it is the same, only publishing public properties of ancestor. Published properties are visible in Object Inspector.
You can eventually use TCustomStringGrid if you will create it in code.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

cazzajay

  • Jr. Member
  • **
  • Posts: 94
Re: TCustomStringGrid vs TStringGrid
« Reply #5 on: October 03, 2011, 12:52:43 pm »
Thanks all!
Windows XP 32 bit / Lazarus 1.0.6 / FPC 2.6.0

 

TinyPortal © 2005-2018