简而言之,我有一个datagrid。我正在从Access Database中检索细节。检索到的数字可以是零(0)。
无论如何在数据网格列中显示零(0)为“ - ”,同时如果数字不为零,我将使用“F4”格式化它
答案 0 :(得分:0)
您可以使用DataGridView
代替DataGrid
来处理CellFormatting
事件,请参阅How to: Customize Data Formatting in the Windows Forms DataGridView Control并执行以下操作:
If e.Value = 0 Then # ommiting type-/errorchecking for brevity
e.Value = "-"
End If