Colorchange in TCRDBGrid
Posted: Tue 11 Jan 2005 12:08
Hello,
how can I change every second row the Color of the Cells of a TCRDBGrid ?
I have made the following:
This doesn't change anything in the Colors of the Cells of the Grid. How can I make it right ?
how can I change every second row the Color of the Cells of a TCRDBGrid ?
I have made the following:
Code: Select all
procedure TForm.CRDBGridDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
if (OraTable.RecNo mod 2) 1 then
begin
Canvas.Brush.Style := bsSolid;
Canvas.Brush.Color := clBlue;
end
else
begin
Canvas.Brush.Style := bsSolid;
Canvas.Brush.Color := clWhite;
end;
CRDBGrid.DefaultDrawColumnCell (Rect, DataCol, Column, State);
end;