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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ExceptionManager not working?

Thread ID:





33059 Aug 11,2005 09:32 PM UTC Aug 15,2005 05:10 PM UTC WinForms 6
Tags: GridControl
Administrator [Syncfusion]
Asked On August 11, 2005 09:32 PM UTC

In our grid, particularly when doing unit testing, we don''t want the grid to catch exceptions, even when drawing cells (such that the cells are drawn in red with the exception text). Instead, we''d like the exceptions to be thrown and caught by nunit during the tests. I cannot seem to get this to work. I''ve tried using: Syncfusion.Windows.Forms.ExceptionManager.PassThroughExceptions = true; At the beginning of my app, but the cells still draw in red with the exception text. Am I missing something?

Administrator [Syncfusion]
Replied On August 15, 2005 01:58 PM UTC

I''m still waiting to hear something on this issue. This is causing us some real problems with our automated testing. Thanks.

Administrator [Syncfusion]
Replied On August 15, 2005 03:17 PM UTC

Pete, what we''ll do is change some lines of code in the OnDrawItem routine. We''ll add a property AllowDrawItemRaiseExceptionCatched which you can then set true. When you set this property true the OnDrawItem routine will forward the exception to RaiseExceptionCatched and then your line Syncfusion.Windows.Forms.ExceptionManager.PassThroughExceptions = true; will work also for drawing exceptions. You need to handle the exception yourself then somehow. Otherwise you''ll have a big red X instead of a grid on your screen. Stefan

Administrator [Syncfusion]
Replied On August 15, 2005 03:27 PM UTC

Stefan, Maybe I''m confused. I don''t want the exception caught in my code or the Syncfusion at all. This is for automated testing with NUnit. If there are any exceptions anywhere in the grid, I want NUnit to see and log the exception so that the test fails. If it''s caught anywhere in the grid and it simply changes the way the grid is drawn (a big red X for example), then it''s unlikely NUnit will catch the error and the test will pass, erroneously. All our tests are run automatically on a remote machine so there''s nobody watching to see if they pass or fail. The only way we know if it fails is if NUnit sees a problem. Pete

Administrator [Syncfusion]
Replied On August 15, 2005 03:40 PM UTC

One other thing I wanted to mention, we''re using version of the Syncfusion controls. We''ve made some fairly substantial changes to the code and are not planning on upgrading at the moment as far as I know (though I believe some people in the group are investigating whether or not to do an update sometime in the near future). Because of that, if there are code changes that need to be made in the Syncfusion code, I''d appreciate knowing where in the code we should make the changes so that we can update our version. Thanks.

Administrator [Syncfusion]
Replied On August 15, 2005 04:10 PM UTC

Pete, if you search for SolidBrush(Color.Red) in the GridControlBase.cs, you will get a hit in OnDrawItem. Right above that line, there are a couple of commented lines. Try uncommenting those lines to see if that allows the exception to occur. I think what Stefan is suggestiong is to conditionally expose those uncommented lines base on the setting of the new property.

Administrator [Syncfusion]
Replied On August 15, 2005 05:10 PM UTC

Clay and Stefan, Thanks, that''s a huge help. I''ll leave a note in our code that when we upgrade, we just need to take advantage of the new functionality, but uncommenting those lines did the trick for this version. Thanks again. Pete


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon