cxgrid中有的记录的是背景颜色要发生变化,有的记录是字体的颜色发生变化。
求救,如何设置?是要全部显示出来的,不是某条记录![可以采用遍历所有记录的方法]请给出点代码。
谢谢~

解决方案 »

  1.   

    第一次发贴,我好象没有分啊?我送段代码 
    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;可以了吧,处理网格颜色的。
      

  2.   

    我把解决贴出来相信还有很多兄弟需要!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;