Autor Beitrag
mexx
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 28.12.05 15:38 
Hallo,

ich möchte jede zweite Zeile eines DBGrid färben. Die Komponente ist aber eine TwwDBGrid und somit etwas anders. Aber vielleicht funktionieren eure Vorschläge ja ebenso.
Ich habe versucht den Index der Zeile auszulesen, den Rest bei einer Division durch 2 zu ermitteln. Im Falle von 0 färben von 1 nicht färben.

So sollte der Code funktinieren.

ausblenden Delphi-Quelltext
1:
2:
  IF DBGridAnzeige. mod 2 = 0 then  ABrush.Color := $00FFF5EC;
  IF DBGridAnzeige. mod 2 = 1 then  ABrush.Color := clWhite;


Nur gibt es keine Methode um den Index herrauszubekommen.
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Mi 28.12.05 16:39 
Wenn an dem Grid ein ClientDataset hängt, könnte das über dei Recno klappen...

_________________
Bravery calls my name in the sound of the wind in the night...
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 28.12.05 16:41 
Wie geht das? :gruebel: