Set colors for DBCtrlGrid's lines

Posted in Databases

Use the OnPaintPanel event:

procedure TForm1.DBCtrlGrid1PaintPanel(DBCtrlGrid: TDBCtrlGrid;
  Index: Integer);
begin
  if Odd(DBCtrlGrid1.DataSource.DataSet.RecNo) then
    DBCtrlGrid1.Color:=clRed
  else
    DBCtrlGrid1.Color:=clBlue;
end;