tcxtreelist 控制单元格变颜色,或者行变颜色

如果控制单元格变颜色,只需要把注释的放开就可以了, 也就是判断当前列,是否是你想让变颜色的列。 如果想整行变颜色, 则只需要注释下面的就可以了。

procedure TfrmwpOrderSendingSet.grdDataCustomDrawCell(Sender: TObject; ACanvas:
TcxCanvas; AViewInfo: TcxTreeListEditCellViewInfo; var ADone: Boolean);
begin
inherited;
// if AViewInfo.Column.Properties is TcxImageComboBoxProperties then
begin
case AViewInfo.Node.Values[MiIsRelease.ItemIndex] of
0: ACanvas.Font.Color := clWindowText;
1: ACanvas.Font.Color := clRed;
2: ACanvas.Font.Color := clBlue;
end;
end;


end;

原文地址:https://www.cnblogs.com/zhangzhifeng/p/4790903.html