Delphi DBGrid 格式显示值 [英] Delphi DBGrid Format Display Values
本文介绍了Delphi DBGrid 格式显示值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要对 DBGrid
中的值进行格式化,以便以某种格式显示,例如 '#,##0.00'
.知道该怎么做吗?
I need to format values in a DBGrid
to display in a certain format ex '#,##0.00'
. Any idea how to do that?
问候,彼得
推荐答案
DataSet 中的每个字段都有两个事件:OnGetText 和 OnSetText.使用所需字段的事件 OnGetText 并使用 Format 函数使用掩码格式化值.
Each Field in your DataSet has two events: OnGetText and OnSetText. Use event OnGetText of desired fields and use Format function to format the value using a mask.
这篇关于Delphi DBGrid 格式显示值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文