I am running Lazarus 0.9.30.2.
I have a TForm on which there is a TStringGrid. Each column title is a TGridColumns object that I added dynamically to the grid at run time. Each column title has an object associated with it (that I created and have stored in a TList). I want to paint the background of the column title cells of the string grid, but I don't want all of the cells to be the same colour. Depending on the value of one of the properties in the object associated with the column title, the colour will vary.
I know that there are answers regarding how to paint TStringGrid cells in Stackoverflow (example), that talk about using the string grids DrawCell event to paint the cells, but I'm not sure how to invoke this procedure.
Is the correct approach to have another procedure that identifies the cell of interest (ie identifies the cells 'Rect' property), sets the colour that I want, that then invokes a common DrawCell procedure of the grid to do the actual colouring?