Subject | First col colouring in IB_Grid |
---|---|
Author | Bernard Collet |
Post date | 2001-11-20T10:24:39Z |
I use IBObjects 4.2.F in Delphi 6.
I use the following GetCellProps event to coulour cells of an IB_Grid
procedure TFormeEntreeSortie.GrilleDepartGetCellProps(Sender: TObject;
ACol, ARow: Integer; AState: TGridDrawState; var AColor: TColor;
AFont: TFont);
begin
if qryDepart.Active and not (gdFixed in AState) and
(ACol <> Abs(qrydepart.OrderingItemNo)) then
if qryDepart.BufferFieldByName('depart').AsDateTime = 0 then
begin
AColor := clLime;
AFont.Color := clBlack;
end
else // Depart <> 0
if qrydepart.BufferFieldByName('retour').AsDateTime = 0 then
if Date + Time <= qrydepart.BufferFieldByName('fin').AsDateTime then
begin
AColor := clYellow;
AFont.Color := clBlack;
end
else // Date + Time > Fin
begin
AColor := clRed;
AFont.Color := clWhite;
end
else // Retour <> 0
begin
AColor := clLime;
AFont.Color := clBlack;
end;
end;
The grid displays some columns from the qryDepart request.
This works very well except for the first data column.
When i go up or down in the grid, the color of the first data column of the new row
stay the same as in the previous row.
Thanks for suggestions ?
[Non-text portions of this message have been removed]
I use the following GetCellProps event to coulour cells of an IB_Grid
procedure TFormeEntreeSortie.GrilleDepartGetCellProps(Sender: TObject;
ACol, ARow: Integer; AState: TGridDrawState; var AColor: TColor;
AFont: TFont);
begin
if qryDepart.Active and not (gdFixed in AState) and
(ACol <> Abs(qrydepart.OrderingItemNo)) then
if qryDepart.BufferFieldByName('depart').AsDateTime = 0 then
begin
AColor := clLime;
AFont.Color := clBlack;
end
else // Depart <> 0
if qrydepart.BufferFieldByName('retour').AsDateTime = 0 then
if Date + Time <= qrydepart.BufferFieldByName('fin').AsDateTime then
begin
AColor := clYellow;
AFont.Color := clBlack;
end
else // Date + Time > Fin
begin
AColor := clRed;
AFont.Color := clWhite;
end
else // Retour <> 0
begin
AColor := clLime;
AFont.Color := clBlack;
end;
end;
The grid displays some columns from the qryDepart request.
This works very well except for the first data column.
When i go up or down in the grid, the color of the first data column of the new row
stay the same as in the previous row.
Thanks for suggestions ?
[Non-text portions of this message have been removed]