如何通过代码调用datagridview的单元格格式化事件? [英] how to call datagridview's cell formatting event by code?

查看:86
本文介绍了如何通过代码调用datagridview的单元格格式化事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将单元格格式的运行时间更改为## 0.00到## 0.000所以如果值为123.45


更改格式后它应显示123.450


我将改变格式取决于其他列值。

解决方案

您好,


您是否尝试通过数字或自定义格式设置如下所示的格式?并且单元数据的类型很重要,因为错误的数据类型将失败而正确的数据类型将起作用。 



I want to change cell format run time like ##0.00 to ##0.000 so if value is 123.45

after change format it should display 123.450

I will change format depends on other column value.

解决方案

Hello,

Have you tried setting the format as shown below via Numeric or Custom format? And the type of the cell data is important in that the wrong data type will fail while the right data type will work. 


这篇关于如何通过代码调用datagridview的单元格格式化事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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