孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

 假设cxgrid为cxMain,TableView为ViewSelData,现在要根据数据集的colColorMark来改变本行的颜色,则可在ViewSelData的OnCustomDrawCell写入
if AViewInfo.RecordViewInfo.GridRecord.Values[colColorMark.Index] = null then Exit;
case AViewInfo.RecordViewInfo.GridRecord.Values[colColorMark.Index] of
  1: ACanvas.Brush.Color := $FF0080;
  2: ACanvas.Brush.Color := $C0C0C0;
  3: ACanvas.Brush.Color := $FFFF80;
  4: ACanvas.Brush.Color := $ABAF8F;
  5: ACanvas.Brush.Color := $CA31CE;
  6: ACanvas.Brush.Color := $E6E8D7;
end;

posted on 2009-10-03 17:00  孤独的猫  阅读(432)  评论(0编辑  收藏  举报