TStringGrid dynamic number of checkbox columns lazarus / 31-LCL ---------------------------------------------------------------------- _N_ · 2021-02-28 18:02 Hello all. I need to create a grid with many checkboxes. To solve the problem I decided to use TStringGrid component as it has ability to have a column of checkboxes. But to be able to set a column of a string grid as column with checkboxes, it is required to set ButtonStyle property of the column to cbsCheckboxColumn and seems that this is possible only via Columns field of the string grid (so I cannot just set Row/ColCount property, because it doesn't work with/update Columns field). Everything works fine when I add certain number of columns manually using form editor, but the problem is that I need to add the columns in a loop at runtime. And here I don't know (and failed to find any info on this) how to manually create a grid column that supports ButtonStyle property with cbsCheckboxColumn value. So, at runtime i have empty AStringGrid.Columns and I want to add an item there, but have no idea of which class it should be and how to add it there correctly. Will the following construction be correct and what descendant of TGridColumn I should use? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i AStringGrid.Columns.Add(SomeTGridColumnDescendant.Create(...));Thank you in advance. ---------------------------------------------------------------------- jamie · 2021-02-28 18:46 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button1Click(Sender: TObject);Var  C:TGridColumn;begin  C:= StringGrid1.Columns.Add;  C.ButtonStyle:=cbsCheckboxColumn;end;                                                    Did you time me ? ---------------------------------------------------------------------- _N_ · 2021-02-28 19:05 Thank you very much! ---------------------------------------------------------------------- jamie · 2021-02-28 20:24 and btw, I could of done it this way too... Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i StringGrid1.Columns.Add.ButtonStyle:=cbsCheckboxColumn; ---------------------------------------------------------------------- speter · 2021-02-28 22:40 You could also look at the TCheckGroup component; it might be simpler. cheers S.