Does anyone know of any reason why all exceptions are handled with in the grid control on the edit complete event?
I realize I can trap it before it exits the event handler and deal with it normally, basically how one would expect in this situation, but I'm more curious for tracking down issues, those exceptions can just disappear making it more difficult to figure out problems.
SHStefan Hoenig Syncfusion Team July 31, 2002 06:40 PM
you can catch the CurrentCellDeactivateFailed or CurrentCellMoveFailed event to be notified when moving the current cell failed, e.g. because of an exception.
In your handler of CurrentCellDeactivateFailed you can then Display a message box or throw the same exception again.
Or if you directly called Validate() or ConfirmChanges() you can check the CurrentCell.ErrorMessage and CurrentCell.IsValid properties.
Unfortunately, right now the exception itsself is not being saved. In our next build of Essential Grid we will provide a CurrentCell.Exception property in addition to the already available CurrentCell.ErrorMessage property.
This will allow you to rethrow any Exception that was catched inside the CurrentCell methods.
Within the Current Cell logic we voted to handle excpetions as a default behavior because there might be cell value conversions that might throw exceptions. For example, if you set CellValueType to be "Byte" and then the user types in a value > 255 a exception is thrown. If an exception dialog is shown, end users would then assume it is a bug in the grid.
SHStefan Hoenig Syncfusion Team July 31, 2002 06:42 PM
If you want to catch exceptions right at the point where they occur, you can do that very nicely with the Visual Studio Debugger when you select the Menu "Debug|Exceptions" and then select "Break Into Debugger" for CLR Exceptions.