iterate dbgrid, color finished row lazarus / 21-General ---------------------------------------------------------------------- musicto · 2024-10-28 10:14 Hi, in my procedure i move through my dbgrid selection like this: 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  for  z := 0 to frm1.dbg2EA.SelectedRows.Count - 1 dobeginfrm1.dbg2EA.DataSource.DataSet.Bookmark := frm1.dbg2EA.SelectedRows[z];         dosomeworkwiththerecord;dosomemoreworkwiththerecord;end;  After i have finished my work for the selected record, i want to color the row before i move to the next one. So the User can easy see the progress of the work. Cant be that hard, but can someone help me please? Sascha ---------------------------------------------------------------------- Handoko · 2024-10-28 14:43 I haven't tried to color a cell or a row in TDBGrid. But it can be done easily in TStringGrid. TDBGrid has OnPrepareCanvas event, so it should be able to be done as in TStringGrid too. I have 2 demos showing how to color a cell/row in TStringGrid. Click the link below, then go to User Interface section. There you can find Searchable StringGrid: https://wiki.freepascal.org/Portal:HowTo_Demos ---------------------------------------------------------------------- Soner · 2024-10-29 20:39 You have to change lazarus\lcl\dbgrids.pas for this: 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 TCustomDBGrid=class(TCustomGrid)// ..public//...property DrawingActiveRecord: Boolean read FDrawingActiveRecord; //for highlighting in PrepareCanvasend;  Then in your programm for TDBGrid.OnPrepareCanvas-Event: 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 DBGrid1.DrawingActiveRecord then begin    //put your code i.e. change row color    DBGrid1.Canvas.Brush.Color:=clRed;     DBGrid1.Canvas.Font.Color:=clWhite; end; ---------------------------------------------------------------------- musicto · 2024-10-30 06:30 Handokos Post gave me the hint and i solved it. So all finished Records are colored. Thank you, Sascha