Cell的Format设置成了##0.0,原先单元格值为空,结果鼠标从该单元格一离开,就变成了0.0,请问应该如何修正?
在GcMultiRow里面做了一个共同方法:
Protected Overrides Sub OnCellFormatting(ByVal e As GrapeCity.Win.MultiRow.CellFormattingEventArgs)
If TypeOf Me.Rows(e.RowIndex)(e.CellIndex) Is NumericUpDownCell _
OrElse Not String.IsNullOrEmpty(e.CellStyle.Format) Then
Dim value As Object = e.Value
If value IsNot Nothing AndAlso Not IsDBNull(value) Then
If IsNumeric(value) Then
e.Value = CDec(value).ToString(e.CellStyle.Format)
End If
End If
End If
MyBase.OnCellFormatting(e)
End Sub |
|