I want to put a TCheckBox
inside a TStringGrid
in Delphi in every cell of certain column. I\'m using Delphi XE.
Don't try to place an actual TCheckBox
control inside a TStringGrid
. Use the grid's OnDrawCell
event with the Win32 API DrawFrameControl()
function instead, to draw an image of a CheckBox control inside each cell as needed. You can use the OnClick/OnMouse...
events with the grid's Objects[][]
property to keep track of each cell's checked state as needed. I find this is a lot easier to manage, since TStringGrid
was not designed to host real controls.