0

简而言之,我有一个数据网格。我正在从 Access 数据库中检索详细信息。检索到的数字可以是零 (0)。

无论如何在数据网格列中将零(0)显示为“-”,同时如果数字不为零,我将使用“F4”对其进行格式化

4

1 回答 1

0

You could use a DataGridView instead of a DataGrid and handle the CellFormatting event, see How to: Customize Data Formatting in the Windows Forms DataGridView Control and do something like:

If e.Value = 0 Then # ommiting type-/errorchecking for brevity
    e.Value = "-"
End If
于 2013-07-25T10:13:39.953 回答