Version: NetAdvantage Select 2010 Vol. 3 (WinForms)Component: Infragistics Ultragrid
Operation system with error: Windows XP Pro
---------------------------
A customer of us is experiencing the "red cross" error followed with an error messages that states:
"object is currently in use elsewhere"
System.InvalidOperationException: The object is currently in use elsewhere
by System.Drawing.Graphics.get_Transform();
by Infragistics.Win.Graphics.Transform.TransformRectangle(Graphics ... ).......
..............
This error throws itself when an user is (re)loading (refresh) the grid with data or using the filter fields on the grid when the data has been bound to the grid.
The application don't use multithreading. There are also no special techniques or such used. Just retrieve data from the SQL server (on the server) and databind the datatable to the grid in the client application.
We never had such experience with this component and other customers with the same application never had or having this problem (running other OS). We also can't reproduce this error on our own developer PC's and on our customer demo server.
Can someone help me in finding out why and how it's possible this customer is the only one experiencing this on all of its workstations or where I have to look for the real cause.
Hi,
Issues like this are extremely difficult to track down - especially if you are unable to duplicate them.
Are you absolutely certain that your application is not using any multi-threading at all?
If so, then the best I can suggest is that you try to find out what's different on the one machine where this is occurring. Perhaps they are using different versions of the Infragistics assemblies? Or perhaps they have a different version of the DotNet framework installed? Maybe there is some other application running on the machine which is interfering with your application?
Thank you for replying!
I'm for 100% sure there is no multithreading in the application.
The form is just a simple form with the ultragrid on it and a button to refresh the data.The user press the button and it retrieve on the same thread data from the database and databind it as a datatable to the grid. Maybe not a nice solution but it works for this customer and others.
Also they use the same assemblies of Infragistics as all of our other customers. This one I know for sure because I've build the projects, distributed and installed these applications.The first thing I'm going to do then is requesting all of the specifications of some of the workstations of this customer. The only "strange" software I saw was software that connected their telephones with the workstations. They can call or answer the telephone with the software. Maybe this can interfere with Infragistics or our application.
As soon as I have discovered some differents that can matter I will post it here.Offcourse when I have the answer I will post it also.
Hello JerryDK,
Please let us know if you still have any other concerns regarding the behavior at your end.
Hello,
I'm sorry for the late response.
The problem still exists but I have narrowed the cause down to the following:
- The red cross only occurs when an user use the filterrow in the ultragrid.
Our customer has sent us screenshots where u can see the red cross but also the first typed letter in a filter field under de columnheader.
So after the first typed letter into this field the red cross is shown.It's configured (default component config) that the grid automatically filter the results after each letter typed.
That's interesting and I have never seen that before. But I'm afraid it does not help us determine the cause of the issue.
Are you handling any events in the grid that might be triggering by a filtering operation? There are the obvious events like Before/AfterRowFilterChanged, of course. And some not-so-obvious ones like IniitalizeRow and maybe Before/AfterRowActivated or Before/AfterSelectChange. Perhaps in one of these events you are using a BeginInvoke or a DoEvents statement that is causing things to get out of synch.
These are all just wild guesses, really, but it's the best I can do without being able to duplicate the issue.
Mike,
The issue was with our code only. Sorry for the trouble. As mentioned earlier we are using a CE database and to check whether the database is already connected instead of using the Connection.State property we used the Connect() property which caused the issue.
Appreciate your immediate reply.
Thanks,
Keerti Somasundaram
Hi Keerti,
Are you using the latest service release?
I did a little research and I came across an interesting blog about this error message: "Object is currently in use elsewhere" error. - Peter Ritchie's MVP Blog
As it happens, although we were never able to reproduce the problem as reported here, we did recently fix a similar issue caused by some caching we were doing with the UltraExplorerBar control.There was a problem in the animation code that wasn't cleaning up properly and it could cause this error.
So if you are using the UltraExplorerBar (or even if you are not), my first recommendation is that you get the latest service release for NetAdvantage and see if that corrects the error.
How to get the latest service release - Infragistics Community
We are experiencing the same issue
below is the exception detail :
System.InvalidOperationException: Object is currently in use elsewhere. at System.Drawing.Graphics.GetNearestColor(Color color) at Infragistics.Win.DrawCache.GetNearestColor(Color color) at Infragistics.Win.DrawCache.Infragistics.Win.IDrawCache.GetNearestBackColor(Color color) at Infragistics.Win.DrawUtility.DrawBackColor(Control control, Graphics graphics, AppearanceData& appearanceData, Rectangle rect, Rectangle invalidRect, Boolean enabled, IDrawCache drawCache, AlphaBlendMode alphaBlendMode, Blend blend) at Infragistics.Win.UIElementDrawParams.DrawBackColor(Rectangle rect) at Infragistics.Win.UIElement.DrawBackColor(UIElementDrawParams& drawParams) at Infragistics.Win.UltraWinToolbars.UltraToolbarsDockAreaUIElement.DrawBackColor(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawHelper(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean clipText, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics) at Infragistics.Win.UIElement.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics) at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize, Boolean preventAlphaBlendGraphics) at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize) at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode) at Infragistics.Win.UltraControlBase.OnPaint(PaintEventArgs pe) at Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.OnPaint(PaintEventArgs pe) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I know its hard to answer with just the exception detail.But if you could give me suggesstions based out of your experience on how to go about it would be great. Our application is a single threaded app. We were using 7.3 version assemblies and we werent facing any issues. We then migrated our app which is a plug-in to a later version of its parent application which was using v10.3 assemblies , we started facing the issue at this point. Then we migrated our assemblies to use v10.3 to see if its because of the assembly mismatch but then it wasnt because of that either. The Infragistics controls are pulling data from a SQL CE database. This is where the crash happens , i can see the IntializeComponent gets executed fine and after that when datasource is getting set this crash occurs.
Any ideas , suggestions are greatly welcome....:)
Keerti
I have adjusted the application by adding code that Updates the grid at BeforeRowFilterChanged.
The component we used is a custom component that inherits the WinGrid.In the component class I have override the paint method and added the base.OnPaint(evtargs)
The customer has not yet encountered a red cross since this update.We also have added a lot of logging and it all seems to go well.
Problem solved