cxGrid常用功能

根据某一列的值,整行以不同颜色显示

procedure TFmMonitor.viewMCustomDrawCell(Sender: TcxCustomGridTableView;
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
var ADone: Boolean);
begin
  if (AViewInfo.GridRecord.Values[TcxGridDBTableView(Sender).GetColumnByFieldName
('totalresult').Index])<>'OK' then
  begin
    ACanvas.Brush.Color := clRed;
  end;
end;

  

原文地址:https://www.cnblogs.com/CipherLab/p/12443938.html