[Lazarus] StringGrid performance problems

Graeme Geldenhuys graemeg.lists at gmail.com
Thu Nov 18 13:27:25 CET 2010

Op 2010-11-18 12:57, zeljko het geskryf:
> So your rowCount doesn't take into account headers and Cells[0,1] := 'MyText' 
> doesn't change header cell text but real cell ?

Correct. Headers are just that, headers (or also known as Columns). Rows
are just that, rows. The concept seems quite logical to me, and I believe
it is similar to what LCL or VCL's ListView does too. In a LCL/VCL
TListview (with Style = vsReport), the Items can be 0, but you still see
column headers. They are handled / setup separately to the data (items or
rows in the control). So why must grids be different.

  Grid1.ColumnTitle[0] := 'test';
  Grid1.ColumnWidth[0] := 80;
  Grid1.Columns[0].Title := 'test';
  Grid1.Columns[0].Width := 80;

...want to hide the headers...

  Grid1.ShowHeaders := False;

...want a empty grid (meaning no rows, but obviously still with headers)

  Grid1.RowCount := 0;

  - Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

More information about the Lazarus mailing list