在你的dbgrid所对应的数据源的table,或者query的,然后再找出字段编辑器,然后你要显示的字段,在它的ongext 事件上,写出
var tybj:string;
flag:=table(query).fieldbyname('字段').asstring;
if flag='1' then
Text:='有'
else
text:='无'
If (Field.FieldName='MZ') And (Field.AsInteger=1) then
DBGrid1.Canvas.TextRect(Rect,Rect.Left+2,Rect.Top+2,'男');
If (Field.FieldName='MZ') And (Field.AsInteger=2) then
DBGrid1.Canvas.TextRect(Rect,Rect.Left+2,Rect.Top+2,'女');