Hello,
we have an application which uses a WinGrid with 3 bands.
On the second band we have 3 columns: Suppliers, Quantities and a third colum which uses a MultiSelect UltraCombo with the list of Orders for that supplier. After selecting the Orders by checking them on the UltraCombo it adds new rows to a third band listing the orders I choosed.
First time it works like a charm! On the BeforeCellListDropDown event I load all the orders for that specific supplier and there's no Errors.
When I pass on to another supplier it throws an Unhandled Exception like on the picture attached. The exception window appears after the BeforeCellListDropDown and not always... but 90% of the time...
It doesn't happen if I select the rows in the combo in order (from top of the list to bottom) as long as I select the first item on the list... everything else throws this error...
What could be wrong?
Please help because this project is due to deliver this week!
Many thanks.
Hi,
I can't see enough of the call stack of the exception to even take a reasonable guess here. Can you post the entire call stack. I'm pretty sure you can copy and paste the text from that dialog.
If you could post a small sample project demonstrating the exception that would be even better. My guess is that the issue has something to do with the fact that you are adding child rows in response to the selection from a DropDown in the grid. But without knowing what your code is doing and what events it's doing it in, it's impossible to guess.
Here's the stack:
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************System.ArgumentOutOfRangeException: Parameter name: iteIndex at Infragistics.Win.UltraWinGrid.UltraDropDownBase.Infragistics.Win.IValueList.ResolveItemAppearance(Int32 itemIndex, AppearanceData& appData, AppearancePropFlags& flags, ComponentRole componentRole) at Infragistics.Win.EditorWithTextUIElement.GetImage(String text, AppearanceData& appData) at Infragistics.Win.EditorWithTextUIElement.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.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.UltraWinGrid.DataAreaUIElement.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.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)
I managed to get some progress on this:
Everytime I do AfterCellListCloseUp (the event that fills the third band with my combo choices) I have to set the editorcomponent to that cell to nothing... and then set the editorcomponent again everytime I go to the Cell... but it's still very shakey... sometimes the problem happens sometimes don't... sometimes I scroll up and down and everything is OK and some times I choose the exact same items and follow the same test sequence and the error appears... this look something to do with the WinGrid Painting... is there anyway to prevent it to do this Painting thus eliminating this message?
Hi Mike,
Thanks for the answer 'en passant'. A well placed ultcmbPartNumbersPreLoadParameters.Refresh() solved the problem with a fairly complex pre load screen that had three Ultra Combos that were extended to do 'search contains' and worked in tandem with three standard multi select combos (side by side) ...
Yes, the control was 'losing' the ValueList when I was checking the box of the CheckEditor column in code.
I had already used the Invoke to help make the pairs work together.
Anyways, that fixed it.
Thanks, wish I would have 'googled' that part of the error message earlier.
Hi again,
Did you look the attached example ?
Regards
Could you please look the attached project. Please try to modify my project to achieve the same issue.
Please keep me in touch
Georgi
Unfortunately no,
I solved the problem using this instead of your MultiSelect Combo:
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=7698
But can you show me a way of using BeginInvoke for adding rows?
Have you been able to resolve your issue with Mike`s help? Please keep us in touch.