Topic: pass a procedure on event
hello
whene i wanted to alternate colors of a dbgrid. there is a message (could not convert variant of type olestr into type boolean)
this is the procedire
procedure Alternate_color( sender:TdbStringGridEx);
var
i,j,maxcol,maxline:integer;
begin
maxline:= sender.rowcount-1;
maxcol:= sender.Columns.Count-1;
for i := 0 to maxcol do
begin
for j := 0 to maxline do
begin
if (j mod 2)=0 then sender.Cell[i,j].color:=$FFFFFF;
if (j mod 2)=1 then sender.Cell[i,j].color:=$FFEEEE;
end;
end;
end;
is there a metjode to do that.
Thank you