|
楼主 |
发表于 2007-7-26 10:51:26
|
显示全部楼层
好,如图。我想现在显示红色的列的每行颜色根据行的某个列字段的至来进行显示或不显示。
如何做? 我没有成功
procedure TFRM_PLCKDXZ.DataTreeList1CustomDrawCell(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TTreeListNode; AColumn: TTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean; var AText: string; var AColor: Integer; AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean);
var
DS:TDataSet;
begin
if not (ASelected or AFocused) then
begin if TDataTreeListColumn(AColumn).FieldName='QTY' then
begin
if TDataTreeListColumn(AColumn).Field.DataSet.FieldByName('QTY').AsFloat >0 then
begin
AFont.Color := Business.System.Graphics.clWhite;
AColor :=Business.System.Graphics.clRed;// $0F0D0F0;
end;
end;
end;
|
|