I am using 2 UltraCombos which make multi selection.
The selection of first ultracombo affect the items of the second ultracombo.
At the AfterCloseUp eventhandler of the firest ultracombo, I change the items of the second ulracombo.
However, after executing the eventhandler, the unknown exception occured.
This is the code.
private void ultraCombo1_AfterCloseUp(object sender, EventArgs e) {
ultraCombo2.DataSource = SharedInfo.SelectedItems;
for (int i = 0; i < ultraCombo2.Rows.Count; i++) { ultraCombo2.Rows[i].Cells["Selected"].Value = true; }
}
The exception is,
위치: Infragistics.Win.UltraWinGrid.UltraDropDownBase.Infragistics.Win.IValueList.ResolveItemAppearance(Int32 itemIndex, AppearanceData& appData, AppearancePropFlags& flags, ComponentRole componentRole) 위치: Infragistics.Win.EditorWithTextUIElement.GetImage(String text, AppearanceData& appData) 위치: Infragistics.Win.EditorWithTextUIElement.PositionChildElements() 위치: Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) 위치: Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) 위치: Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) 위치: Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) 위치: Infragistics.Win.UIElement.DrawHelper(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean clipText, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics) 위치: Infragistics.Win.UIElement.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics) 위치: Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize, Boolean preventAlphaBlendGraphics) 위치: Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize) 위치: Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode) 위치: Infragistics.Win.UltraControlBase.OnPaint(PaintEventArgs pe) 위치: Infragistics.Win.UltraWinGrid.UltraCombo.OnPaint(PaintEventArgs e) 위치: System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) 위치: System.Windows.Forms.Control.WmPaint(Message& m) 위치: System.Windows.Forms.Control.WndProc(Message& m) 위치: System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 위치: System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 위치: System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 위치: System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) 위치: System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) 위치: System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) 위치: System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) 위치: System.Windows.Forms.Application.Run(Form mainForm)
Hi,
What kind of exception is it?
My best guess is that the second Combo has a value and when you change the list, you are changing or removing the item on the list that matches that value. So you might just want to set the second Combo's value to null first, because you change the list, and see if that helps.
The UltraCombos have a band which has two columns that are "Selected" and "Value".
"Selected" column for multi selection, "Value" column for item list.
You said that the second Combo's value to null first, and then change the list,
but if I set the second Combo's DataSource to null, the "Selected" column is removed.
So another exception occur named "Argument Excetpion : key not found".
I'd like to know how to change the datasource of "Value" column in UltraCombo.
I set the value property of the ultraComb2 as you said, but the exception is still thrown.
I don'know why it happens.
Exception message is...
"System. ArgumentOutOfRange Exception. Parameter Name : iteIndex..............:
Please let me know how to resolve this.
Thanks,
guidegi said: Exception message is... "System. ArgumentOutOfRange Exception. Parameter Name : iteIndex..............:
Well, that further reinforces my theory. The control is trying to resolve the appearance of an item that no longer exists. I would think that setting the control's Value to null before you clear and repopulate the list should fix that. But if that's not working, then I am out of ideas.
Can you post a small sample project which demonstrates the exception so we can take a look at it?
I attached a sample project that shows similar exception.
When I change the datasource of UltraCombo which has selected value,
the exception occur.
What do I have to do with your sample in order to get the exception to occur. I ran the sample, dropped down the first combo, selected some values, and then closed the combo, but I got no exceptions - everything worked just fine.
Perhaps you just need to get the latest service release.
How to get the latest service release - Infragistics Community
Hi Mike,
Thanks for your help.
After installing the service release, the exception does not occur any more.