查询一个布尔型字段,在DBGrid中显出来时一般是false或是true。小弟想用‘是’或‘否’来代替显示。请各位高手指点!!!谢谢!!!!
解决方案 »
- Delphi 封装串口通讯为DLL - 欢迎高手来探讨 - 首次发帖,大虾们顶啊!
- 如何把DELPHI里的变量向fastreport中的memo赋值?
- 谁能帮我解决一个问题啊??
- XMLDocument的用法,在线等~~
- 打印的问题。各位高手请进。
- [急急急]如何调入字段名为中文的表单生成报表的问题???
- WEB浏览器
- 各位,DELPHI的文件操作用起来怎么那么不爽呢!
- 有关数据库的路径问题?请高手解答
- 紧急求救:在dbgrid控件上,当把所有的记录都选上后,怎么才能点其中一条纪录时,使这条记录不选中,而其他记录仍然选中?
- 请问谁能提供点数据库或者MIS方面的毕业论文(答辩格式的),我想参考一下格式
- 在线高分求救!!谁能提供Delphi的反编译软件??
select ID,Bool = case bool
when False then '否'
when True then '是'
end
from A
procedure TPersonalForm.DBGrid2DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
If gdSelected In State then
begin
DBGrid2.Canvas.Brush.Color := clMoneyGreen;
DBGrid2.Canvas.Font.Color := clRed;
end
else
DBGrid2.Canvas.Brush.Color := clWhite;
DBGrid2.DefaultDrawColumnCell(Rect, DataCol, Column, State);
If (Column.FieldName='Money') Or (Column.FieldName='Cash') Or (Column.FieldName='Price') Or (Column.FieldName='Leave') then
begin
With DBGrid2.Canvas do
begin
FillRect(Rect);
TextRect(Rect,Rect.Left,Rect.Top,Format('%m',[Column.Field.AsFloat]));
end;
end;
end;