* * *

Author Topic: TCustomStringGrid vs TStringGrid  (Read 1917 times)

cazzajay

  • Jr. Member
  • **
  • Posts: 83
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

IPguy

  • Sr. Member
  • ****
  • Posts: 304
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: 83
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?

Shebuka

  • Sr. Member
  • ****
  • Posts: 325
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: 835
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 0.9.31 r37217M FPC 2.5.1 r21251 x86_64-linux-qt/gtk2

cazzajay

  • Jr. Member
  • **
  • Posts: 83
Re: TCustomStringGrid vs TStringGrid
« Reply #5 on: October 03, 2011, 12:52:43 pm »
Thanks all!

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads