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?
AStringGrid.Columns.Add(SomeTGridColumnDescendant.Create(...));
Thank you in advance.