Ja. haben schon gelöst. Danke
Delphi-Quellcode:
Procedure Tf_hauptfenster.DGBRIG_OnDrawColumnCell(Formular:TForm);
var I : Integer;
begin
With Formular do
begin
for i:= 0 to ComponentCount-1 do
begin
IF (Components[i] is TDBGrid) Then
begin
TDBGrid(Components[i]).OnDrawColumnCell := DbGrib_DrawColumnCell_Einstellung;
end;
end;
end;
end;
procedure Tf_hauptfenster.DbGrib_DrawColumnCell_Einstellung(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
IF TDBGrid(sender).DataSource.DataSet.RecNo = 0 Then Exit;
If Frac(TDBGrid(sender).DataSource.DataSet.RecNo / 2) > 0 then
TDBGrid(sender).Canvas.Brush.Color:=Dbgrib_farbe_1 else
TDBGrid(sender).Canvas.Brush.Color:=Dbgrib_farbe_2;
TDBGrid(sender).DefaultDrawColumnCell
(Rect, DataCol, Column, State);
end;
Beim Create eines formulares einfach mit f_hauptfenster.DGBRIG_OnDrawColumnCell(self) aufrufen..
Richtig?