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

ExceptionManager not working?

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?

6 Replies

AD Administrator Syncfusion Team 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.

AD Administrator Syncfusion Team 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

AD Administrator Syncfusion Team 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

AD Administrator Syncfusion Team 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.

AD Administrator Syncfusion Team 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.

AD Administrator Syncfusion Team 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

Live Chat Icon For mobile
Up arrow icon