第一次发贴,我好象没有分啊?我送段代码 procedure TM4_TechnicsProcessForm.tvQueryStylesGetContentStyle( Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle); begin if ARecord is TcxGridDataRow and not ARecord.Selected then begin if ARecord.Values[clnEngineer.Index] = Null then begin if ARecord.Values[clnNotOddState.Index] = '工艺协助' then AStyle := styWaitAidance else if ARecord.Values[clnNotOddState.Index] = '工艺处理' then AStyle := styWaitDispose; end else if ARecord.Values[clnEnginneerUserID.Index] = UserId then if (ARecord.Values[clnNotOddState.Index] = '工艺处理') or (ARecord.Values[clnNotOddState.Index] = '工艺协助') then AStyle := styMeDo; end; end;可以了吧,处理网格颜色的。
我把解决贴出来相信还有很多兄弟需要!procedure TForm.tvQueryStylesGetContentStyle( Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle); begin if ARecord is TcxGridDataRow and not ARecord.Selected then begin if ARecord.Values[clnNotOddState.Index] = '工艺协助' then begin AStyle.Color := ; AStyle.TextColor := ; end else if ... then else if ... then ... end; end;
procedure TM4_TechnicsProcessForm.tvQueryStylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
begin
if ARecord is TcxGridDataRow and not ARecord.Selected then
begin
if ARecord.Values[clnEngineer.Index] = Null then
begin
if ARecord.Values[clnNotOddState.Index] = '工艺协助' then
AStyle := styWaitAidance
else if ARecord.Values[clnNotOddState.Index] = '工艺处理' then
AStyle := styWaitDispose;
end
else if ARecord.Values[clnEnginneerUserID.Index] = UserId then
if (ARecord.Values[clnNotOddState.Index] = '工艺处理') or
(ARecord.Values[clnNotOddState.Index] = '工艺协助') then
AStyle := styMeDo;
end;
end;可以了吧,处理网格颜色的。
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
begin
if ARecord is TcxGridDataRow and not ARecord.Selected then
begin
if ARecord.Values[clnNotOddState.Index] = '工艺协助' then
begin
AStyle.Color := ;
AStyle.TextColor := ;
end
else if ... then
else if ... then
...
end;
end;