用代码改的好像保存不了,放在AfterOpenProject比较合适。
所有数值列:
For Each dt As DataTable In DataTables
If dt.Type = 1 OrElse dt.Type = 3 Then
For Each dc As DataCol In dt.DataCols
If dc.IsNumeric Then
dc.Decimals = 2
dc.SetFormat("#0.00")
End If
Next
End If
Next
单精度、双精度、高精度:
For Each dt As DataTable In DataTables
If dt.Type = 1 OrElse dt.Type = 3 Then
For Each dc As DataCol In dt.DataCols
If dc.DataType.Name = "Double" OrElse dc.DataType.Name = "Single" OrElse dc.DataType.Name = "Decimal" Then
dc.Decimals = 2
dc.SetFormat("#0.00")
End If
Next
End If
Next
[此贴子已经被作者于2013-12-27 13:50:17编辑过]