Hello, how can I improve the code so that it does not draw bold text in columns?
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if Column.FieldName = 'Category' then begin
ImageList1.Draw(DBGrid1.Canvas, Rect.Left, Rect.Top, 0)
end;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
"
does not draw bold text in columns" - if this means: the text in the columns should not be bold, the answer is: Don't add the fsBold style to the DBGrid1.Canvas.Font.Style or DBGrid1.Font.Style - you must be doing this somewhere because this is not default behaviour, but, of course, I don't know where you do this since you do not show this code.
If it means: there should not be ANY text in the columns, the answer is: Remove the call to DBGrid1.DefaultDrawColumnCell from above code.