I have Infragistics 9.2.20092.2119 ( even after I downloaded the latest service release yesterday ) I am continously getting this error. This form has a Ultragrid with row summary
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Infragistics.Shared.SparseArray.ValidateIndex(Int32 index)
at Infragistics.Shared.SparseArray.GetItem(Int32 index, ICreateItemCallback createItemCallback)
at Infragistics.Win.UltraWinGrid.RowsCollection.InternalTraverseRowsHelper(UltraGridBand band, IRowCallback rowCallback, IRowsCollectionCallback rowsCollectionCallback, Boolean recursive, Boolean includeTemplateAddRows)
at Infragistics.Win.UltraWinGrid.RowsCollection.InternalTraverseRowsHelper(UltraGridBand band, IRowCallback rowCallback, Boolean recursive)
at Infragistics.Win.UltraWinGrid.SummaryValue.CalculateSummaryValue(RowsCollection rows, SummarySettings summarySettings)
at Infragistics.Win.UltraWinGrid.SummaryValue.CalculateSummaryValue()
at Infragistics.Win.UltraWinGrid.SummaryValue.get_Value()
at Infragistics.Win.UltraWinGrid.SummaryValue.get_SummaryText()
at Infragistics.Win.UltraWinGrid.SummaryValueUIElement.PositionChildElements()
at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
at Infragistics.Win.UltraWinGrid.RowColRegionIntersectionUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
at Infragistics.Win.UltraWinGrid.DataAreaUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
at Infragistics.Win.UltraWinGrid.UltraGridUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
at Infragistics.Win.UIElement.DrawHelper(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean clipText, 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)
at Infragistics.Win.UltraWinGrid.UltraGridUIElement.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode)
at Infragistics.Win.UltraControlBase.OnPaint(PaintEventArgs pe)
at Infragistics.Win.UltraWinGrid.UltraGrid.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(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)
The second error I get is I have a form with Ultragrid and UltraGridExcelExporter
and the error is
System.ArgumentException: 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 Pearlpos.Forms.ItemListView.InitializeComponent() at Pearlpos.Forms.ItemListView..ctor()
System.ArgumentException: 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 Pearlpos.Forms.ItemListView.InitializeComponent()
at Pearlpos.Forms.ItemListView..ctor()
Here's the stack trace of the error I am getting
at System.Drawing.Image.get_FrameDimensionsList() at System.Drawing.ImageAnimator.CanAnimate(Image image) at Infragistics.Win.AnimatedImageManager.AnimateHelper(Image image, UIElement owningElement, Boolean isBackgroundImage) at Infragistics.Win.ImageUIElementBase.DrawImage(UIElementDrawParams& drawParams) at Infragistics.Win.ImageAndTextUIElement.ImageAndTextDependentImageUIElement.DrawImage(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(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.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) 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) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
DeclaringMethod = 'DirectCast(DirectCast(e.Exception._exceptionMethod, System.Reflection.RuntimeMethodInfo).DeclaringType, System.RuntimeType).DeclaringMethod' threw an exception of type 'System.InvalidOperationException'
Hi.. I have been having this problem for a while now too. I'm interested in why using threads would be an issue and if there is a way to still use threading and not get this error.
We run some checks on the number of items in several areas to update the toolbar items with the numbers (we have not yet implemented the badges yet, but plan to) and in the worker completed event we update the toolbar items with the new settings.
We also use the tabbed mdi control with the toolbar manager.
Any suggestions on where to look or what to look for would be greatly appreciated.
Hi,
If you can post a sample project so we can duplicate the exception, we can certainly look into it.
My guess is that this was a bug in the 9.2 version of the controls. The version you are using was the last service release, so it's possible that this bug went unnoticed until after the 9.2 version was retired.
Are you using formulas in for your summaries (or anything else)? Or are you just using the built-in summaries?
If you are using formulas, then you might be able to work around this by setting the FormulaRowSourceIndex to something other than VisibleIndex.
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridOverride ov = layout.Override; ov.FormulaRowIndexSource = FormulaRowIndexSource.RowIndex; // or //ov.FormulaRowIndexSource = FormulaRowIndexSource.ListIndex; }
If that doesn't work, I recommend that you try downloading a trial version of NetAdvantage 11.2 and see if the problem is fixed in the latest version.
Thanks for the reply. I am using WinForms on Dot Net Framework 4.0. Using Model View Presenter Pattern. Grid Control is in Win Form and all the code that handles the events are in the seperate Presenter Class. Usually I always check my code for bugs. But this one I am confused by the exception message. I am pasting the error stack. i will also email the sample project.
What's a "presenter pattern?" Are you using WPF or Windows forms?
If you are using the latest version and not using threading, then either this is a bug in the control or lse something in your code is causing it.
Can you post a small sample project demonstrating the exception so I can take a look? Without being able to reproduce the issue, I'm afraid I can't do much except make some pretty wild guesses.