Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含很多行的 DataGridView,并且一些单元格值类型是十进制的。在某些行中,我需要十进制类型的单元格为空。 例如: 如果单元格值为 0,则将单元格留空而不是 0。 有可能吗?如果是,那么如何? 提前致谢。
处理CellFormatting事件。您将从args表示未格式化值的事件中获取传入的值。
CellFormatting
args
转到属性并将空值设置为零或对所有单元格使用循环并检查它们的值