Selected row colour lazarus / 16-Databases ---------------------------------------------------------------------- pcurtis · 2020-06-09 16:02 How do I change the selected row colour? ---------------------------------------------------------------------- wp · 2020-06-09 16:45 Selected Row of a TDBGrid? Use the OnPrepareCanvas event and try this code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.DBGrid1PrepareCanvas(sender: TObject; DataCol: Integer;  Column: TColumn; AState: TGridDrawState);begin  if ([gdSelected, gdFocused] * AState <> []) then begin    if (DBGrid1.SelectedColumn = Column) then begin      DBGrid1.Canvas.Brush.Color := clRed;      DBGrid1.Canvas.Font.Color := clWhite;    end else    begin      DBGrid1.Canvas.Brush.Color := RgbToColor(255, 128, 128);      DBGrid1.Canvas.Font.Color := clBlack;    end;  end; end; This is for row-select mode, but you certainly can adapt it to normal single-cell mode easily. ---------------------------------------------------------------------- pcurtis · 2020-06-09 16:56 Cheers! ---------------------------------------------------------------------- Focus77 · 2020-06-11 19:00 Hello ! But did you notice that if  dgRowselect=True The left and the right buttons don't work ?