procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if column.FieldName='字段名' then
begin
if column.Field.Value=1 then
column.Field.AsString:=ready;
if column.Field.Value=2 then
column.Field.AsString:=out;
end;
end;
不好意思.下面是我试过的...
procedure TForm1.IBTable1idGetText(Sender: TField; var Text: String;
DisplayText: Boolean);
begin
if sender.Value=1 then
text:='ready';
if sender.Value=2 then
text:='out';
end;
添加永久字段,在ONGETTEXT里写
给分吧[]
to y2ky2k:你是在说dbgrid吗?我怎么找不到你说的事件?
问题已经解决了,我用sql语句搞定的。
也许是我表述不清吧
select agent_Stats
case agent_Stats.Status when 1 then 'Ready'
when 2 then 'Wrap'
end as Status
from.....