DEV cxgrid 自绘相关

procedure cxgrdbndclmn_jgzqCustomDrawCell(
  Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
  AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
 ts:integer;
begin
 ts := 0;
 trystrtoint(VartoStr(AViewInfo.GridRecord.DisplayTexts[cxgrdbndclmn_jgzq.Index]), ts);

 if ts = 3 then
  ACanvas.Brush.Color := RGB(255,192,105)
 else if (ts >3) and (ts <=5) then
  ACanvas.Brush.Color := RGB(250,68,28)
 else if ts > 5 then
  ACanvas.Brush.Color := RGB(207,19,34);

 if ts >=3 then
 begin
  AViewInfo.EditViewInfo.TextColor := clwhite;
  AViewInfo.EditViewInfo.BackgroundColor := ACanvas.Brush.Color;
  AViewInfo.EditViewInfo.Paint(ACanvas);
  ADone := True;
 end;  
end;

 

posted @ 2024-11-29 17:18  Tag  阅读(2)  评论(0编辑  收藏  举报