Dear WP, This is superb!!!! Thank you very much.
I've compiled your example and it works well. Now I'm trying to integrate into my Project.
However, I have a little challange with the
OnPrepareCanvas . I have a column with a PickList as its editor. This PickList has names of different colors such that when a user picks up a color, that entire row is painted with that color. But it seems I'm failing to adapt it to the code you've provided. Please, look at my code and guide me;
if (Sender as TStringGrid).Cells[4, aRow] = 'AntiqueWhite' then begin
(Sender as TStringGrid).Canvas.Brush.Color := TColor($FAEBD7);
end else if (Sender as TStringGrid).Cells[4, aRow] = 'Aqua' then begin
(Sender as TStringGrid).Canvas.Brush.Color := TColor($00FFFF);
end else if (Sender as TStringGrid).Cells[4, aRow] = 'Aquamarine' then begin
(Sender as TStringGrid).Canvas.Brush.Color := TColor($7FFFD4);
end else if (Sender as TStringGrid).Cells[4, aRow] = 'Azure' then begin
(Sender as TStringGrid).Canvas.Brush.Color := TColor($F0FFFF);
end else if (Sender as TStringGrid).Cells[4, aRow] = 'Beige' then begin
(Sender as TStringGrid).Canvas.Brush.Color := TColor($F5F5DC);
end
The compilation is fine but when it comes to printing, it throws an error on those color names (strings) in the fourth column cells. I've also attached an image to show this runtime error.
Thanks