comment faire?
comment faire?
En cherchant un peu peut-être ? http://delphi.developpez.com/faq/?pa...#couleurdbgrid
je veut alterner 2 couleur lors de l'affichage
http://delphi.developpez.com/faq/?pa...leurstringgrid à adapter au DBGrid.
En utilisant la propriété RecNo.
ca marche bien avec un TQuery mais pas toujours avec TTable.
un bout de code
Mettre la propriété la propriété Defaultdraw à false
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 procedure TForm.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin if (QClients.RecNo mod 2=0) then // QClients dans ce cas est une Tquery begin if Dbgrid1.Canvas.Brush.Color=Dbgrid1.Color then Dbgrid1.Canvas.Brush.Color:=clskyblue; end; DBGrid1.DefaultDrawColumnCell(Rect,Datacol,Column,State); end;
Partager