SH
Stefan Hoenig
Syncfusion Team
July 31, 2002 11:40 PM UTC
Hello Trevor,
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.
Stefan
SH
Stefan Hoenig
Syncfusion Team
July 31, 2002 11:42 PM UTC
I forgot.
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.
Stefan