0
I’m having trouble changing the text color of the records displayed in Dbggrid in Delphi Berlin (10.1 update 1). When trying to change the font color and turn on italics and bold, all records appear correctly except the selected record that displays duplicate text, one with the font changes and the other without any change. It is worth noting that the font below is only for testing so it changes the color of all records in the system there will be situations where this color will be changed or not. Follows below excerpt of the code and image that illustrates the problem.
procedure TForm2.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
TDBGrid(Sender).Canvas.Font.Style := [fsItalic, fsBold];
TDBGrid(Sender).Canvas.Font.Color := clMaroon;
TDBGrid(Sender).Canvas.FillRect(Rect);
TDBGrid(Sender).DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
What Benjamin Said is true I went through this problem and in this website I found a way to fix or ease the situation
– ProsTecnologia