We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Exceptions in CurrentCellEditComplete Event

Thread ID:

Created:

Updated:

Platform:

Replies:

693 Jul 31,2002 11:49 AM Jul 31,2002 07:42 PM Windows Forms 2
loading
Tags: GridControl
Trevor Redfern
Asked On July 31, 2002 11:49 AM

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.

Stefan Hoenig [Syncfusion]
Replied On July 31, 2002 07:40 PM

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

Stefan Hoenig [Syncfusion]
Replied On July 31, 2002 07:42 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;