"Parameter is not valid.
at System.Drawing.Graphics.GetHdc() at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter..ctor() at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter..ctor(IContainer container) at MyGrid..ctor()"
For some reason, after a period of time, whenever one of my win forms loads, and there's a grid to be initialised, I get the above error. The error persists until the application is restarted. Has anybody else seen this? I am using 8.3.20083.2021. I'm sure I've seen somewhere that it may be down to the number of window handles it uses up, as there is a leak of sorts. I realise that I could upgrade to the latest version, but management will not allow this unless there is a very good reason as it envolves a mass roll out to thousands of user machines. Perhaps there is a hot fix.
If somebody could let me know in which version it was found and perhaps in which version is has been fixed?
Thanks for any help, Andrew
Hi Andrew,
I've never seen an error like this before that I recall.
I suppose a memory leak could explain this. That should be easy enough to check. Bring up your task manager in Windows and there's a Performance tab that shows you the current number of handles.
Hi Mike,
I have an open case number for this - "CAS-40329-O7D41C".
You'll be able to see all the detail in there, but I am suggesting there is a problem with the cached graphics mechanism in the UltraExplorerBar control (which seems to be a univeral mechanism across infragistic controls, including the UltraGridExcelExporter). We are seeing the problem, specifically when an UltraExplorerBar group is selected.
internal void AnimateGroupSelection(UltraExplorerBarGroup newSelectedGroup)(UltraExplorerBar.cs – Line 17485)
(DrawUtility.ReleaseCachedGraphics() is not being called within AnimateGroupSelection which I believe is causing the problem).
In our code, if we select the group .Selected = True we get the error in our main application. If we omit this, the problem goes away.
It took us 3 - 4 days (changeset by changeset in Team Foundation Server) to work this one out.
(I did by the way check the windows handles on a few of our servers where users run the application, and all looked normal. Handles did not go over 600 at any point in the day).
Kind regards,
Andrew
Hi,
I am still getting this issue infrequently on Production.
It is producing on only one client but I am unable to reproduce it on my local system. I have Infragistics V12.1 Version.
The code which is causing problem is as below:-
this.ultraGridExcelExporter = new Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter(this.components);
Please let me know if this issue is fixed or there is any Hotfix available for this.
Thanks,
Kuldeep Agrawal
Can you tell me anything more about the circumstances under which it occurs?
For example, does it happen when your application has been running for a long time? Or does it happen immediately after the app has only been running for a few minutes?
Are you sure the customer's machine is using the same version of the Infragistics assemblies that you are?
Does it happen when exporting a large Excel file or does it also happen for smaller files?
Hey Mike,
There is no certain scenario in which it is reproducing. Client was not doing anything with excel exporting etc at the time the error popped up.
And client is also using the same version of Infragistics as I am.
Please let me know if any workaround is available.
Kuldeep
Hi Kuldeep,
Without more information about when the problem occurs, I'm afraid I cannot guess what's causing it. The best suggestion I can offer is that you upgrade to the latest service release (if you don't already have it) and see if that helps.
How to get the latest service release - Infragistics Community
Our application was using the old version of infragistics(8.0 version), now we have upgraded it to v13.1. We didn't redo all the form just updated with the new version of infragistics. Now and then the user are getting this.
System.Drawing.Graphics.GetHdc()
at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter..ctor()
at GLS.Framework.UI.BaseForm.InitializeComponent()
at GLS.Framework.UI.BaseForm..ctor()
Also other items we are getting this error
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key) at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at System.Data.DataView.System.Collections.IList.get_Item(Int32 recordIndex) at Infragistics.Win.UltraWinGrid.RowsCollection.SyncRowsHelper(IList boundList) at Infragistics.Win.UltraWinGrid.RowsCollection.SyncRows() at Infragistics.Win.UltraWinGrid.RowsCollection.VerifyGroupByVersionHelper() at Infragistics.Win.UltraWinGrid.UltraGridRow.get_ParentRow() at Infragistics.Win.UltraWinGrid.UltraGridRow.get_BaseHeight() at Infragistics.Win.UltraWinGrid.UltraGridRow.get_HeightInsideRowBorders() at Infragistics.Win.UltraWinGrid.UltraGridRow.GetLevelHeight(Int32 level) at Infragistics.Win.UltraWinGrid.UltraGridColumn.AdjustForCellLevel(Rectangle& rect, UltraGridRow Row) at Infragistics.Win.UltraWinGrid.RowCellAreaUIElementBase.AddElementHelper(UIElementsCollection oldList, Type type, Rectangle rcElement, Rectangle rcClip, UltraGridRow row, UltraGridColumn column, Boolean& sameRow, Boolean activeRowStatusChanged, Boolean rowLayoutMode)
at Infragistics.Win.UltraWinGrid.RowCellAreaUIElementBase.PositionChildElements() at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.RowColRegionIntersectionUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.UltraGridUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
at Infragistics.Win.UIElement.VerifyChildElements(Boolean recursive) at Infragistics.Win.ControlUIElementBase.VerifyIfElementsChanged(Boolean verify, Boolean syncMouseEntered) at Infragistics.Win.ControlUIElementBase.ProcessMouseMoveHelper(Object sender, MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseMove(Object sender, MouseEventArgs e) at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) at Infragistics.Win.UltraControlBase.OnMouseMove(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseMove(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Any help or suggestions will be really helpful.
That Exception is very vague and can occur for any number of reasons. Have you tried getting the latest service release?
If that doesn't help, can you reproduce the issue in a small sample project and post it here so we can check it out?
We are using Infragistics 14.1 WinForms and we are getting this error from production as well.
is there any solution to this?
Details:
Inner Exception:
Parameter is not valid.
at System.Drawing.Graphics.GetHdc()
at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter..ctor(IContainer container)
its also happened with me in this version 13.1.20131.2124 not in exporting just in initializing in this generated code
Me.UltraGridExcelExporter1 = New Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter(Me.components)
Same link I gave you several posts back.
Anyway, threading issues can be like that. They are quirky and sometimes you can just get lucky and they don't happen until you move something around or shift the timing. Or, I could be wrong and the issue is nothing to do with threading.
If you can duplicate the exception in a small sample project, we'd be happy to take a look, but that sample should not include any background threads to eliminate that as the possible cause.
Where can I get the service Release for 13.1.
Yes, my application use background threads. but we didn't have this issue with the earlier version of infragistics but just this release.