OS:Windows 10@64
CODE: FPC-Lazarus 3.4
Project: Add a column by code
//---PrintGrid:TStringGrid
PrintGrid.InsertColRow(TRUE,PrintGrid.ColCount);
PrintGrid.Columns[PrintGrid.ColCount-1].Alignment:=taCenter;
I'm missing something and have tried everything I can think of
PrintGrid.Columns.Add; failed
PrintGrid.InsertColRow(TRUE,0); failed
the presets are FixedCol=0, FixedRow:=10;
no columns have been added with the StringGrid column editing tools.
To me it's like the column gets created temporary but Grid dose not register the new column and any columns[aCol] parameter will produce invalid index exception
Even tried PrintGrid.Invalidate after InsertColRow but that didn't help.
UPDATE...... If I use the StringGrid IDE column tools to add a column then everything works but I just don't know how to do that with code.