cxGrid1DBBandedTableView1CustomDrawCell绘图时,满足查询条件的Cell显示特定的颜色
procedure TfrmDataExport.cxGrid1DBBandedTableView1CustomDrawCell(
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
i,iCellIndex : Integer;
begin
for i := 0 to AViewInfo.GridView.ItemCount - 1 do
begin
if (Pos(Edit1.Text,VarToStrDef(AViewInfo.GridRecord.Values[i], '')) > 0) and
(VarToStrDef(AViewInfo.GridRecord.Values[i], '') <> '') and
(AViewInfo.Item.ID = i) then
begin
ACanvas.font.color := $8080F0;
ACanvas.brush.color := clYellow;
end;
end;
//if ((AViewInfo.Item.Index = 3) or (AViewInfo.Item.Index = 4)) then //第几列
end;