CXGRID中行背景色根据数据库某一字段值发生变化,如审核状态
procedure TShoesErp_Pack_PackStockInForm.ABcxGrid1ABcxGridDBBandedTableView1CustomDrawCell(
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
AColumn: TcxCustomGridTableItem;
begin
AColumn:=TABcxGridDBBandedTableView(Sender).GetColumnByFieldName('AuditFlag');
if Assigned(AColumn) then
if VarToStr(AViewInfo.GridRecord.Values[AColumn.Index]) = '' then
ADone:=false
else
if (AViewInfo.GridRecord.Values[AColumn.Index]) then
acanvas.Brush.Color:=TColor(ABGetSysParamValue('AuditFlag',''));
end;