If you call the closeup() method on a additional button in a combo since the Microsoft updates KB3023222 KB3023224 this throws an exception:
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll
Additional information: Operation is not valid due to the current state of the object.
Removing the updates resolves the issue but of course leaves the end user open to the vulnerabilities the patch is supposed to fix.
This issues occurs in .net 4 / 4.5 / 4.5.1 with infragistics 14.1
To replicate add a combo to your form add a month calendar to your form. Add a buttonright to your combo of type drop down and select the month calendar as the control.
Add an event on date selection to close the drop down and it will throw the error.
private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e) { var btn = (Infragistics.Win.UltraWinEditors.DropDownEditorButton)ultraCombo1.ButtonsRight[0]; btn.CloseUp(); }
I have attached a sample project file that replicates the issue
But thew
private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
{
var btn = (Infragistics.Win.UltraWinEditors.DropDownEditorButton)ultraCombo1.ButtonsRight[0];
btn.CloseUp();
}
Yep. That's exactly the way to do it. :)
ok found an answer myself, was quite simple
private delegate void delegateExitEditMode(); private void grid_CellChange(object sender, CellEventArgs e) { BeginInvoke(new delegateExitEditMode(exitEditMode)); } private void exitEditMode() { grid.PerformAction(UltraGridAction.ExitEditMode); }
Hi,
I'm getting the error in a Wingrid in the CellChange Event, when I call grid.PerformAction(UltraGridAction.ExitEditMode); after choosing a date in a date column.
(didn't check other dropdowns in the grid because they just get enabled after the date selection)
Can you please provide the according invoke solution for wingrid?
Thx in advance
Tobi
Hi Vivek,
No, this is not fixed. In fact, this may not be fixable on our end. The DateTimeEditor is basically getting it's Windows Handle re-created while it's in the middle of processing a mouse message.
I recommend using the workaround. It's very easy and it should fix the problem.
Has this been fixed now ?