procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin
with DbGrid1 do begin case Odd(DataSource.Dataset.Recno) of //Ligne impaires en jaune true: Column.Color := clYellow; //Lignes paires, couleur par défaut False: Column.Color := clWindow; end ; DefaultDrawColumnCell(Rect, DataCol, Column, State); end; end;
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionwith DbGrid1 do begin case Odd(DataSource.Dataset.Recno) of //Ligne impaires en jaune true: Column.Color : = clYellow; //Lignes paires, couleur par défaut False: Column.Color := clWindow; end; DefaultDrawColumnCell(Rect, DataCol, Column, State); end; end;