procedure TfrmOrderMgr.grdVMainStylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
var
AIndex: Integer;
AVar: Variant;
ABoolean: Boolean;
lvItem: TcxGridDBColumn;
begin
lvItem := TcxGridDBColumn(AItem);
if grdVMainFCompleted.GroupIndex <> -1 then Exit; //分组时不分颜色
AIndex := grdVMainFCompleted.Index;
AVar := ARecord.Values[AIndex];
if VarIsOrdinal(AVar) then ABoolean := AVar else ABoolean := false; //是否为bool值
if ABoolean then //已完成
AStyle := dmMain.cxStyleRecCompleted else AStyle := dmMain.cxStyleRecNormal;
if lvItem.VisibleIndex = 0 then //第一列
begin
AIndex := grdVMainFClosed.Index;
AVar := ARecord.Values[AIndex];
if VarIsOrdinal(AVar) then ABoolean := AVar else ABoolean := false; //是否为bool值
if ABoolean then //已取消
AStyle := dmMain.cxStyleRecClosed;
end;
end;