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. Image for the cookie policy date

Suppressing Exception Catching

The Syncfusion KB says this: "How to control the way the grid handles the exceptions There is a class Syncfusion.Windows.Forms.ExceptionManager that has static members that you can use to control how the grid handles exceptions. For example, to suspend the grid''s error handling, try: [C#] Syncfusion.Windows.Forms.ExceptionManager.SuspendCatchExceptions(); [VB] Syncfusion.Windows.Forms.ExceptionManager.SuspendCatchExceptions() You can also hook an event (Syncfusion.Windows.Forms.ExceptionManager.ExceptionCatched) to get any exception thrown, and handle them yourself or re-throw them." *Where* should such a line of code be called from?

1 Reply

ST stanleyj Syncfusion Team January 6, 2006 06:57 AM UTC

Hi Plioi, If you want to catch errors while the grid is being initially created then you may subscribe this handler in the form''s constructor before the InitializeComponent call, as the grid is usually created in the InitializeComponent call from the forms constructor. ExceptionManager.ExceptionCatched += new ExceptionCatchedEventHandler(ExceptionManager_ExceptionCatched); Then in the handler you would condition resume or suspend CatchExceptions depending upon what you want the grid to do. private void ExceptionManager_ExceptionCatched(object sender, ExceptionCatchedEventArgs e) { // if you want the grid to rethrow the exception, call ExceptionManager.SuspendCatchExceptions(); // if you want the grid to eat the exception (ignore it), then call ExceptionManager.ResumeCatchExceptions(); } Best regards, Stanley

Loader.
Live Chat Icon For mobile
Up arrow icon