Delphi DBGrid格式显示值 [英] Delphi DBGrid Format Display Values

查看:354
本文介绍了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?

请问,Pieter

推荐答案

DataSet中的每个字段都有两个事件:OnGetText和OnSetText。使用所需字段的OnGetText事件,并使用格式函数使用掩码格式化值。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆