Learning Delphi (have a ways to go), using Rio.
I figured out how to use a colored background in TStringGrid
rows - but it looks like I need to refresh when data in those rows changes (so as to get different colors to show up based on the data changes).
I thought that just setting the cell values to their then-existing values would cause the refresh. But it didn't. I could tell for sure that it didn't - because I had a debug breakpoint placed within the StringGrid1DrawCell
procedure - and that breakpoint was not hit.
The code that I had been using to hopefully cause the refresh in TStringGrid
was as follows (note: S
is defined as a String
):
S := StringGrid1.Cells[1, i];
StringGrid1.Cells[1, i] := S;
Is the basic assumption (that just setting/resetting values of the cell contents causes a refresh) in error?
If the idea is right, but the method is wrong: could you let me know what to do differently?