I have a WinGrid with a CalculatorDropDown as a cells editor component. I have the cell formatted with a dollar sign and four places after the decimal place. Everything works fine if you only make changes to the cell value as soon as you enter the cell (it strips out the dollar sign) or if you make changes via the CalculatorDropDown. However, if you make changes using the CDD and then realize that the value you got was not correct and attempt to make changes directly in the cell, it throws the value in editor is not valid error (can't convert value to decimal). I have the following Code in the CellDataError event:
Private Sub ugFeeSched_CellDataError(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CellDataErrorEventArgs) Handles ugFeeSched.CellDataError Try e.RaiseErrorEvent = False e.RestoreOriginalValue = False e.StayInEditMode = False Catch ex As Exception HandleError(ex, Name, "ugFeeSched_CellDataError") End Try
End Sub
The grid still restores the original value? Is this by design or is there something I am missing in my code?
Any help would be greatly appreciated.
The RestoreOriginalValue property is only applicable when StayInEditMode is set to true. You can't get out of edit mode with a value that can't be parsed into a valid value through any combination of property settings on the event args because it is not possible to coerce a value out of the data. I'm not clear on exactly what you are trying to accomplish here but if you want to strip out the currency symbol you could do that using the IEditorDataFilter interface.